Re: [PHP] mysql_fetch_array problem? O.o
Jeff Ostapchuk wrote: Ok, I have no clue what version of PHP I have installed, 4.??.??, and I have like the newest version of MySQL insatlled, and PHP and MySQL work fine together, excpet when I use mysql_fetch_row($query) then I have problems, mysql_fetch_array($query) works fine, but not mysql_fetch_row($query). Why doesn't it work? I tried installing the new PHP 5 version, but when i extracted it from the zip file into the C:\PHP folder and then PHP didn't even work at all (so... u can kinda tell i'm a still a noobie at this ^.^;;; ) Thank in advance to whoever. mysql_fetch_row() will return false if you are already on the last row in your result set. You also need to pass both mysql_fetch_array() and mysql_fetch_row() the resource id from a successful mysql_query() call. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_fetch_array problem? O.o
Hello Jeff, Thursday, April 15, 2004, 3:18:53 AM, you wrote: JO> Ok, I have no clue what version of PHP I have installed, 4.??.??, and I have Find out: (view it in a browser) JO> like the newest version of MySQL insatlled, and PHP and MySQL work fine JO> together, excpet when I use mysql_fetch_row($query) then I have problems, What error does it give you? What actually happens? Post some of your code perhaps? More info needed, mysql_fetch_row certainly works so whatever the cause, it's AYE (at your end). -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_fetch_array problem? O.o
Ok, I have no clue what version of PHP I have installed, 4.??.??, and I have like the newest version of MySQL insatlled, and PHP and MySQL work fine together, excpet when I use mysql_fetch_row($query) then I have problems, mysql_fetch_array($query) works fine, but not mysql_fetch_row($query). Why doesn't it work? I tried installing the new PHP 5 version, but when i extracted it from the zip file into the C:\PHP folder and then PHP didn't even work at all (so... u can kinda tell i'm a still a noobie at this ^.^;;; ) Thank in advance to whoever. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_fetch_array problem
hi everyone! i'm new here (and new to php) and have a question. i'm trying to run a simple blogger type script but am running into a problem i can't seem to troubleshoot. first, the three items i put into the database aren't showing up on my page and then when i try to go to the archive for the month, i get the following: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/blar/public_html/inc/main_inc.php on line 11 here's a part of my code of main_inc (first line is line 11): function showPosts($result,$page) { if ($myrow = mysql_fetch_array($result)) { do { $rawdate = $myrow["postDate"]; $formdate = date("l, F j, Y", (strtotime(ereg_replace('([0-9]*)-([0-9]*)-([0-9]*)','\2/\3/\1', $rawdate; if ($date != $formdate) { $date = $formdate; ?> http://blar.org http://uglypropaganda.com