So far, I'm only working on the first 2 columns, Placeholder and English Text.

//Placeholder
$query_ph = "SELECT ph_name from placeholder";
$result_ph  = mysql_query($query_ph) or die('Query failed:'.mysql_error());

//English Text
$query_en = "SELECT text from content WHERE lan_id=1";
$result_en = mysql_query($query_en) or die('Query failed:'.mysql_error());
?>

  1. Точность превыше всего

    Date: 11/25/06 (Code WTF)    Keywords: mysql, sql

    //pi to 1000 decimals. If you want more accuracy, bring it out even further. I dont think that you
    //would want to have it any more accurate than this anyways hehe.
    $pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117
    06798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493
    03819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602
    49141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951
    94151160943305727036575959195309218611738193261179310511854807446237996274956735188575272489122793
    81830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748
    18467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050
    79227968925892354201995611212902196086403441815981362977477130996051870721134999999837297804995105
    97317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083
    81420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927
    8766111959092164201989;

    А дальше эта переменная идет в матоперации в SQL запрос для MySQL

    Source: http://community.livejournal.com/code_wtf/59207.html

  2. mysql podcasts!

    Date: 12/14/06 (MySQL Communtiy)    Keywords: php, mysql, browser, html, sql, web

    I realized I haven't told Livejournal about the MySQL Podcast that's been produced. The third episode has been published -- see http://www.technocation.org to subscribe or search for "mysql" or "oursql" on your favorite site to find podcasts, including itunes. Episode 0 and Episode 1 are still available.

    Episode 2 is here! It's a bit late due to a computer crash and the fact that I sprained my ankle, but I think it's worth waiting for. Particularly since this week's feature is everyone's favorite -- performance tips!


    It's best to subscribe to the podcast by clicking the "podcast" graphic at http://www.technocation.org , or searching for "mysql" in your favorite podcast directory (including iTunes). But if you want to play episode 2 in your browser, visit http://technocation.org/index.php?option=com_content&task=view&id=22&Itemid=29

    Please consider promoting the show -- we have a 40 second promo ready for download at:

    http://www.technocation.org/podcasts/oursql/OurSQLpromo1.mp3

    Show Notes:
    News

    http://www.mysqlconf.com/

    Free Survey, win a free pass

    http://www.zoomerang.com/recipient/survey-intro.zgi?p=WEB225WZRG2XU7

    You can now find this podcast, OurSQL, on many podcast sites including:


    http://www.itunes.com

    http://www.podcastalley.com

    http://www.podfeed.net

    http://www.podcastblaster.com


    just search for "mysql" on any of those sites and you'll find the podcast. You can also find it at:


    http://feeds.feedburner.com/oursql


    Learning Resource

    Promo

    http://www.tech-in-sight.com/

    Feature

    Peter Zaitsev's blog post about count for InnoDB tables:
    http://www.mysqlperformanceblog.com/2006/12/01/count-for-innodb-tables/

    Acknowledgements/Sponsors

    http://www.technocation.org

    http://music.podshow.com

    http://www.russellwolff.com

    http://www.smallfishadventures.com/Home.html "The Thank you song" -- Smallfish




    You can Direct download oursql podcasts at:
    http://technocation.org/podcasts/oursql/

    If you have any feedback about this podcast, or want to suggest topics to cover in future podcasts, please email

    podcast@technocation.org

    You can also:

    Call the comment line at +1 617-674-2369

    Or use Odeo to leave a voice mail through your computer:
    http://odeo.com/sendmeamessage/Sheeri

    Or use the Technocation forums:
    http://tinyurl.com/sc6qw

    Source: http://community.livejournal.com/mysql/107360.html

  3. Dreamhost

    Date: 12/14/06 (PHP Community)    Keywords: php, mysql, sql, hosting

    DreamHost seem to get recommended every time anyone asks for a good host, but, has anyone had any problems?

    My current host (square1hosting.com) are sucking harder than something that sucks very hard, and have been for some time.

    I need a PHP5 host with MySQL and email for multiple domains at a reasonable price, dreamhost seems to be unbelievably good, which suggests to me they may be overloaded and therefore performance/availability might be dire.

    Anyone have any problems?

    Source: http://community.livejournal.com/php/521140.html

  4. PHP quiz scripts

    Date: 12/14/06 (PHP Community)    Keywords: php, mysql, sql

    I used a quiz script from Dodo in the past, but in september I switched hosts for my domain, and after I had uploaded all the files I discovered that the script just wouldn't work. The script is just a bunch of php files and my new host supports PHP just like my old host.

    Anyone used this script before?

    Where would I start troubleshooting? What things are significant in this host-switching case?

    I also tried to upload the uncustomized default files that came with the script, and still nothing. If the case is that it won't work whatever I do...



    Do any of you have a link to another linkware PHP non-MySQL quiz script? I need this: 10 questions w/ radiobuttons. If you have 7 or more correct you get sent to pageA.php, if you have 6 or less you go to pageB.php

    Thanks

    Edit: I got help and it works now:)

    Source: http://community.livejournal.com/php/520922.html

  5. Functions

    Date: 12/14/06 (MySQL Communtiy)    Keywords: mysql, sql

    I have a cluttered query to get the next week-day (minus weekends) which I'd like to place in a function to be used over and over. 

    Is there a way to write query snippets as a custom function for MySQL?    (something like SELECT NEWFUNCTION();)

    Source: http://community.livejournal.com/mysql/107585.html

  6. creating polls (huge security hole?)

    Date: 12/15/06 (WebDesign)    Keywords: php, mysql, sql, web

    So I'm reading a tutorial on creating polls using MySQL and PHP, and this is the php side of it.

    Is it me, or is this extremely bad to put on a webpage, what with it requiring a usename and password? Am I just not reading it properly?

    $host = 'localhost';
    $user = 'user';
    $pass = 'pass';

    $db = 'polls';
    print "\n";
    print "\n";
    print "Grand Old Opera Poll\n";
    print "\n";
    print "\n";
    print "
    \n";
    print "

    Which of these activities do you most enjoy?

    \n";
    $dbcon = mysql_connect($host, $user, $pass)
    or die('Unable to connect to server ' . $host);
    mysql_select_db($db) or die('Unable to find database ' . $db);
    $form_query = 'SELECT * FROM poll_answers';
    if($result = mysql_query($form_query)) {
    while($row = mysql_fetch_array($result)) {
    print "". $row['activity'] . "
    \n";
    }
    }
    print "\n";
    print "
    \n";
    print "

    See vote totals

    \n"
    ;
    print "
    \n";
    print "
    \n";
    ?>

    Source: http://community.livejournal.com/webdesign/1195771.html

  7. Finnish mySQL support was 3rd most-read story of 2006 on open source blog

    Date: 12/18/06 (Open Source)    Keywords: mysql, database, sql, web

    Small companies face a Hobson's Choice as they grow. They may start with mySQL, a solid, simple database, but they wonder whether it will scale as they grow. Given the penchant of Web companies to grow exponentially if they turn out to be winners, this is a question that is occuring earlier-and-earlier in these companies' lives.

    Source: http://feeds.feedburner.com/~r/zdnet/open-source/~3/63255940/

  8. PHP/MySQL question

    Date: 12/18/06 (PHP Community)    Keywords: php, mysql, sql

    I am applying for a job and have been working with PHP since PHP3, unfortunately not so lucky with MySQL and have only been working with that for about 2 years now and still feel awkward with it.

    So the job interviewed me and wants me to come back to take a 1 hour test to make sure that my knowledge matches what they want, or what level my knowledge is at, not sure which. I was wondering if anyone would have any suggestions what areas I should sharpen up on/make sure I know all the options/tricks etc. on? And also does anyone know any self-scoring or automated PHP or PHP/MySQL tests out there on the net or care to make one? Would be much appreciated. I was using the Zend Certification book as a guideline but I'm too busy correcting typos and wondering what's write and wrong in the book :\

    Thanks!

    Source: http://community.livejournal.com/php/523205.html

  9. MySQL Database Podcast!

    Date: 12/19/06 (MySQL Communtiy)    Keywords: php, mysql, software, html, sql, java, spam, microsoft

    Episode 3 is here!

    If folks have ideas or suggestions for content, please let me know.



    You can Direct download all the oursql podcasts at:
    http://technocation.org/podcasts/oursql/

    Direct play this edition at:

    http://tinyurl.com/yy7pgz



    News

    Download MySQL Turbo Manager Free Edition at: http://www.mentattech.com/themes/mentat/download.html



    Wireless providers prefer MySQL over Oracle, Microsoft SQL Server over both:

    http://www.crn.com/sections/breakingnews/breakingnews.jhtml?articleId=196700062


    Learning Resource

    Artful Software's list of common queries. They also have an interesting e-book available, called "Get it Done with MySQL 5.0".

    http://www.artfulsoftware.com/queries.php


    DATEDIFF(), DAYOFWEEK() functions

    http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html

    Promo

    This week’s promotion comes from Geek Fu at http://www.geekfuactiongrip.com



    Feature

    Concurrency and Isolation Levels
    http://sheeri.net/index.php?p=123



    Acknowledgements

    http://www.technocation.org

    http://music.podshow.com

    http://www.russellwolff.com

    http://www.smallfishadventures.com/Home.html "The Thank you song" -- Smallfish


    Feedback

    If you have any feedback about this podcast, or want to suggest topics to cover in future podcasts, please email

    podcast@technocation.org This email address is being protected from spam bots, you need Javascript enabled to view it

    You can also:

    Call the comment line at +1 617-674-2369

    Or use Odeo to leave a voice mail through your computer:
    http://odeo.com/sendmeamessage/Sheeri

    Or use the Technocation forums:
    http://tinyurl.com/sc6qw

    Source: http://community.livejournal.com/mysql/108124.html

  10. Security concerns with User Sessions

    Date: 12/20/06 (PHP Community)    Keywords: mysql, database, sql, security

    As part of a development project, I'm currently developing a site which will require user login to access most of the actual site content. However, I want to ensure that I set this up with the most common security holes taken into account.

    The user data is stored in a MySQL database, with the username stored in cleartext and the password field contains the md5 hash of the actual password concatenated with a 10 character random salt string (which is stored in the database as cleartext).

    Login form data is passed via POST. Any data that is taken from or generated from the user will be passed through a sanitization function to prevent SQL injection attacks.

    To track the user's state, I am looking into using session variables. My current problem is how to determine if the user has been authenticated properly, ideally without having to make a database call on every single page where this needs to be verified.

    Does anyone have any suggestions as to some ways to authenticate the contents of a session to prevent man-in-the-middle/replay attacks? The obvious way would be to store the session ID in the database and check it every time, but that adds a lot of overhead.

    Also, if anyone can spot any glaring security issues that I've missed in the descriptions above, I'd really like to hear about it. I want to do this right the first time.

    Source: http://community.livejournal.com/php/523861.html

  11. Nested Loops??

    Date: 12/23/06 (PHP Community)    Keywords: php, mysql, html, sql

    Hi everyone, I'm a bit confused with PHP While Loops. =/

    Currently, I want to echo a table that has 4 columns, "Placeholder (ph_name)", "English Text (text)", Foreign Text (text area)", "Action (save)". 

    When I view the page, the table cells are all jumbled up.

    the html codes should look like that:

ph_nametexttext areasave

 
// Get each row of data on each iteration until there are no more rows

while($row_ph = mysql_fetch_array($result_ph)){
echo "";
echo "";

          while ($row_en = mysql_fetch_array($result_en)){
               echo "";
}
}
?>
PlaceholderEnglish TextForeign TextAction
";
echo $row_ph['ph_name'];
echo "
";
               echo $row_en['text'];
               echo "


How should I nest the loops? 
Thanks! (:

x-posted to '[info]'php_mysql

Source: http://community.livejournal.com/php/525071.html

  • PHP/MySQL connection error

    Date: 12/29/06 (PHP Community)    Keywords: php, mysql, sql

    Anyone have any idea why after establishing a pconnect with my MySQL server previously in the script when I try and run a query later on (without closing the connection) it throws the following error :

    Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\AppServ\www\movies_dev\movies.php on line 18

    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\AppServ\www\movies_dev\movies.php on line 18


    Ignore the line numbers infront of the code behind the cut, I pasted it on a pastebin and it threw it's own line numbers in and I don't have the time to cut them out.



    1.
    // this is the db_fns.php include file
    2.

    3.

    18.

    19.
    //
    20.

    21.
    //this is the main php file:
    22.

    23.
    \n\n\n";
    51.
    // echo "test run 1";
    52.
    echo "

    \n";
    53.
    echo "\n";
    54.
    echo "\n";
    55.
    echo "\n";
    56.
    echo "\n";
    57.
    echo "\n";
    58.
    echo "";
    59.
    }
    60.
    ?>
    61.

    62.
    // this is the error:
    63.

    64.
    Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\AppServ\www\movies_dev\movies.php on line 18
    65.

    66.
    Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\AppServ\www\movies_dev\movies.php on line 18
    67.
    Error with query /# 1


    Source: http://community.livejournal.com/php/525946.html

  • Fun game

    Date: 01/02/07 (Javascript Community)    Keywords: php, mysql, html, sql, java, spam

    I must have a bot watching my site, here is an example
    http://www.tfcdesign.com/spilledink/classifieds/sifc002n.html

    When I clear out their spam, it fills up immediately. Its kinda fun. Right now I have a javascrip that redirects their IP shows up. Apparrently JS doesnt work.

    The scripts are all perl and I havent used perl in over 6 years :) This site has been self maintaining since 1996.

    So, now I get to try and beat the bot.

    I've redone the site in PHP and MYSQL here
    http://www.spilledink.com/classifieds/electronics.php

    so it isn't a big deal. I havent shut down the old site because I make money from both.

    Eventually, the new site will be like Craigslist requiring a valid email and email validation. For this site I think I'll have to use PERL to kick this guy. ... or maybe just submit the form with javascript.

    Is there a way to tell if a specific visitor has javascript enabled? I'll have to see if PERL can do this.

    Source: http://community.livejournal.com/javascript/122894.html

  • Давайте писать PHP игрушку.

    Date: 01/03/07 (PHP Development)    Keywords: php, mysql, sql

    Ищу людей для создания на общественных началах PHP BBMMOG. Понимаю, что это велосипед, который не гоже изобретать. Но важна не только цель, но и процесс!!!

    Приветствуются: графика, вебдезайн, идеи, желание создать свой игровой мир и управлять им.
    Предполагаемые направления:

  • бизнес / финансы
  • сельское хозяйство (по мотивам Harvest the moon - от нинтендо)
  • околодайвинговая тема
  • любые другие направления

    Что есть:
  • Желание творить
  • Хостинг с поддержкой PHP5 и MySql
  • Множество идей
  • Опыт в ООП, PHP, SQL и т.п.

    Можно писать напрямую мне.
  • Source: http://community.livejournal.com/php_dev/75394.html

  • PHP/MySQL Help

    Date: 01/05/07 (WebDesign)    Keywords: php, mysql, html, database, sql, web

    Hoping somebody here can help me..

    I'm going through the book PHP and MySQL Web Development by Luke Welling and Laura Thompson. I'm currently working through Chapter 26 (for those of you that have read it), Building User Authentication and Personalization. I've gotten through it pretty good so far, but am having some trouble with actually authenticating the user logins. My site is set up at http://test.aacapartsandsupplies.com. My problem is, whenever I click the login button, I always go to the member.php page.. even if I didn't put any login information in. It doesn't throw back any errors saying "you must be logged in to view this page", etc. Even if I do login, and I try to logout from member.php, it throws back the exception "you were not logged in, and so have not been logged out." I have registered some test users, and this happens on every login I've created.

    I'm not exactly sure where the problem lies. I'm wondering if anyone has read this book and might be able to help me out. Even if you haven't read it and know more about PHP/MySQL than I do, I'd appreciate any kind of help. Posting the code for the two files where I *think* the problem lies.


    < ?php

    // include function files for this application
    require_once('tokens_fns.php');
    session_start();

    //create short variable names
    $username = $_POST['username'];
    $passwd = $_POST['passwd'];

    if ($username && $passwd)
    // they have just tried logging in
    {
    try
    {
    login($username, $passwd);
    // if they are in the database register the user id
    $_SESSION['valid_user'] = $username;
    }
    catch(Exception $e)
    {
    // unsuccessful login
    do_html_header('Problem:');
    echo 'You could not be logged in.
    You must be logged in to view this page.';
    do_html_footer();
    exit;
    }
    }

    do_html_header('');

    display_user_menu('');

    check_valid_user('');

    ?>

    < div id="right">
    < div id="title">
    < h1>Welcome to your AACA Locker < ?php $_POST['username'] ?>
    < /div>

    Thanks for logging in! You may now view your custom reports, vote in our
    polls, and be sure to check for any rewards you may have won!


    < /div>

    < ?php

    do_html_footer('');
    ?>



    This is simply the login and check_valid_user functions:

    function login($username, $passwd)
    // check username and password with db
    // if yes, return true
    // else throw exception
    {
    // connect to db
    $conn = db_connect();

    // check if username is unique
    $result = $conn->query("select * from user
    where username='$username'
    and passwd = sha1('$passwd')");
    if (!$result)
    throw new Exception('Could not log you in.');

    if ($result->num_rows>0)
    return true;
    else
    throw new Exception('Could not log you in.');
    }

    function check_valid_user()
    // see if somebody is logged in and notify them if not
    {
    if (isset($_SESSION['valid_user']))
    {
    echo '
    ';
    echo 'Logged in as '.$_SESSION['valid_user'].'.';
    echo '
    ';
    }
    else
    {
    // they are not logged in
    echo '
    ';
    echo 'You are not logged in.
    ';
    exit;
    }
    }


    I can provide more code if needed.

    Thank you all in advance!!

    Source: http://community.livejournal.com/webdesign/1203673.html

  • Need Help

    Date: 01/08/07 (WebDesign)    Keywords: php, mysql, blogging, sql

    I need some help. I am working on my layout for my site. However, when I add the "blogging" tool that I am using with PHP the whole layout becomes wacked and out of order, I can't seem to figure it out.

    http://www.silence-stars.net/ (correct way)

    That is my site, its fine now, but if add the "blog" to the site, it becomes wacked.

    http://www.silence-stars.net/test.php

    Maybe I need another pair of eyes, maybe one of you can help me decipher where my problem is.

    But all in all, I need some critique on my site, what are your opinions?

    Edit
    Blogging tool is Cutenews. My site doesn't support MySQL so I can't use wordpress, or anything like it.

    Source: http://community.livejournal.com/webdesign/1205140.html

  • Character problems

    Date: 01/11/07 (MySQL Communtiy)    Keywords: mysql, software, database, sql, web

    I am running MySQL 4.1.22 on Windows 2000, and I'm having problems with European characters.

    When data is input through the software that uses it, European characters are converted into strange symbols that may or may not display properly in a web context. For instance É looks like É in the database, ü comes out as ü.

    When I input the data through SQLyog, everything from the first European character to the end of the string is cut off.

    I am using utf8_general_ci, which is how the software set up the database. What am I doing wrong, or what else should I be looking for?

    Thanks for any help you can offer.

    Source: http://community.livejournal.com/mysql/108461.html

  • Menus not working in Firefox?

    Date: 01/11/07 (Web Development)    Keywords: php, mysql, css, html, database, sql, web

    I run a fan website and I'm currently having a problem with the navigation menu in one section.

    The section is PHP/MySQL based (the other parts of the site are static HTML at the moment) and can be found here: http://www.selenayhaven.com/reviews/ It's the green left-hand navigation side bar that has problems reported. It uses unordered lists and CSS to acheive the 'button' appearance, following a tutorial from A List Apart. It works absolutely fine on all the instances of Firefox, Opera and IE that I've tested it on and other users report that it works in Safari. However, one user reports that the menu doesn't work when she clicks on it and I honestly cannot work out why.

    Menus in the rest of the site (e.g. http://www.selenayhaven.com/gate/index.html) were constructed slightly differently (no lists) and my user has no problem with them. I decided to do them differently when I set up the database area because I thought it would be better from an accessibility POV - how wrong I was, apparently!

    My query is whether anyone else using Firefox cannot use the problem navigation menu and whether anyone can suggest how I might be able to fix it. I'm about to start sorting out the site to accommodate IE7, so I want to make sure that I'm starting with a site that works properly before making yet more changes. My problem user has tested the site in both Firefox 1.5 and 2.0.

    Source: http://community.livejournal.com/webdev/382284.html

  • Help with creating an Administrator page.

    Date: 01/12/07 (PHP Community)    Keywords: php, mysql, database, sql, web

    Hello! This is my first post on LiveJournal.
    I'm making a website for the group that I'm in, and I have a little bit of self-taught PHP & MySQL experience, but I'm up to the point of making the administration section so we can update the site without any hassle.

    All I need is a little bit of a push to start me rolling (so to speak)
    Any help is appreciated and will get a spot in the credits for the site.

    What I need is:
    *Admin Login.
    *Posting Support.
    *Managing of posts.
    *Page authoring (eg... projects.php?id=XX (where 'XX' is projects name)).
    *News authoring.

    (MUST INCORPORATE MYSQL DATABASE!)

    Any little bit of code would be great, just as long as it gets me started!
    Thank you!

    Source: http://community.livejournal.com/php/529282.html

  • Seeking open source (or at least, freely available) project management software

    Date: 01/15/07 (Computer Geeks)    Keywords: mysql, software, database, sql, web, linux, microsoft

    I'm trying to find something that will do approximately what Microsoft Project does, without actually being Microsoft Project ... Things I'd be looking for (ordered approximately from most important, to least important...):


  • Can track project schedules and resource allocation

  • Open Source (or at least, freely available)

  • Self-contained standalone application (e.g., not web based, does not require any additional software such as MySQL or some other database back-end to be installed in order to function)

  • Runs on both Windows and Linux

  • Ability to work with (at least read) MS Project ".mpp" files nice, not strictly necessary



  • I found "Windows Planner" (a Windows port of GNOME Planner) on Sourceforge. Unfortunately, while it does install on my WinXP SP2 system, it does not run - attempting to start it results in a DLL error. There are some other things on Sourceforge that look very nice, but they all seem to either be web-based, or require a database back-end, and that won't work for what I'm doing at the moment.

    Any recommendations?

    Source: http://community.livejournal.com/computergeeks/1023035.html

    Previous page  ||  Next page


    antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home