Re: PHP 4.2.0 on win2k, can't use mysql_fetch_* functions
| From: | Austin W. Marshall | Date: | Tue, 30 Apr 2002 01:45:41 +0000 |
| Subject: | Re: PHP 4.2.0 on win2k, can't use mysql_fetch_* functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95305@lists.php.net to get a copy of this message | ||
Actually, i just used desc for the sake of demonstration, the actual column name was description. At this point i don't care any more, this was done on a computer for testing purposes and is no longer an issue. I was just curious to know if this is a known bug or if it's just some odd anomoly. Must be an anomoly.
John Holmes wrote:
The only problem I can see is that you have a column named 'desc' which is a reserved word. It can cause weird results some times, but seems like it would cause an error.... Don't know what to tell you... ---John Holmes...errors-----Original Message----- From: Austin W. Marshall [mailto:amars@pdq.net] Sent: Monday, April 29, 2002 1:58 PM To: 1LT John W. Holmes Cc: php-general@lists.php.net Subject: Re: [PHP] PHP 4.2.0 on win2k, can't use mysql_fetch_*functions1LT John W. Holmes wrote:itThere's a difference between error_reporting and display_errors. Also, are you _really_ sure your query is returning anything? You may _think_ it is, but if mysql_fetch_array doesn't return anything, thenturnmeans your result set is empty. 9 times out of 10 this is going tooutwasn't...to be something dumb like a variable was empty that you thoughresultsShow us the code. ---John Holmes...I can't remember exactly, this was on asomeone elses computer over the weekend, i don't normally use php in windows, but the fact that it didn't work, really bothered me. But it was something along the lines of <?php mysql_connect("localhost","",""); <-- yes the grant tables are set up that way mysql_select_db("vendor"); <-- the db with the conent $query="SELECT code,desc FROM codes"; $result=mysql_query($query); while($code=mysql_fetch_array($result)) // or list($code_id,$desc)=mysql_fetch_row($result) but with the same{ echo "$code[code] $code[desc] <br>"; //print_r($code) doesn't do anything either } ?> That's basically all there is to it. I know for a fact that there is stuff in the codes table, because not only did i manually insert data,ihad another script insert data (to verify that other mysql functions worked) and issuing the exact same query manuall yields what it's expected to. I understand your point about the query not returning anything, but it can't get any simpler than select code,desc fromcodes,which will return everything and code and desc are the only fields.functions----- Original Message ----- From: "Austin Marshall" <amars@pdq.net> To: "1LT John W. Holmes" <holmes072000@charter.net> Cc: <php-general@lists.php.net> Sent: Monday, April 29, 2002 4:34 PM Subject: Re: [PHP] PHP 4.2.0 on win2k, can't use mysql_fetch_*Of Course, i think i even had it at the highest alert level. No1lt John W. Holmes wrote:Did you turn on Display_errors in php.ini? ---John Holmes...
functionswhatsoever, ... or die(mysql_error()) yields nothing either.----- Original Message ----- From: "Austin W. Marshall" <amars@pdq.net> To: <php-general@lists.php.net> Sent: Monday, April 29, 2002 3:52 PM Subject: [PHP] PHP 4.2.0 on win2k, can't use mysql_fetch_*
MySQLIs there something about the php 4.2.0 windows binary (installer version) that renders the mysql_fetch_* functions useless? I installed php 4.2.0 on windows 2000 along with Apache 1.3.24 and
content3.23.49, and in a script i have a simple SELECT statement. The
anything.is in the database, the query executes successfuly, but it's as if mysql_fetch_array and mysql_fetch_row functions don't return
Onworking,I know mysql support is built-in (as indicated on php.net) andbecause i was able to use php to insert data into the database.
thatin noone computer i was able to recreate the problem consistently and
boxen,situation would mysql_fetch array or _row return anything. I haven't had the opportunity to try this on any other win2k
butam not having any problems in Linux or OpenBSD. Is anyone else experiencing any problems? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php