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... > -----Original Message----- > From: Austin W. Marshall [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 29, 2002 1:58 PM > To: 1LT John W. Holmes > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] PHP 4.2.0 on win2k, can't use mysql_fetch_* functions > > 1LT John W. Holmes wrote: > > >There'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, then it > >means your result set is empty. 9 times out of 10 this is going to turn > out > >to be something dumb like a variable was empty that you though wasn't... > > > >Show 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 results > { > 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, i > had 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 from codes, > which will return everything and code and desc are the only fields. > > >----- Original Message ----- > >From: "Austin Marshall" <[EMAIL PROTECTED]> > >To: "1LT John W. Holmes" <[EMAIL PROTECTED]> > >Cc: <[EMAIL PROTECTED]> > >Sent: Monday, April 29, 2002 4:34 PM > >Subject: Re: [PHP] PHP 4.2.0 on win2k, can't use mysql_fetch_* functions > > > > > > > > > >>1lt John W. Holmes wrote: > >> > >> > >>>Did you turn on Display_errors in php.ini? > >>> > >>>---John Holmes... > >>> > >>> > >>Of Course, i think i even had it at the highest alert level. No errors > >>whatsoever, ... or die(mysql_error()) yields nothing either. > >> > >> > >> > >>>----- Original Message ----- > >>>From: "Austin W. Marshall" <[EMAIL PROTECTED]> > >>>To: <[EMAIL PROTECTED]> > >>>Sent: Monday, April 29, 2002 3:52 PM > >>>Subject: [PHP] PHP 4.2.0 on win2k, can't use mysql_fetch_* functions > >>> > >>> > >>> > >>> > >>> > >>>>Is 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 > MySQL > >>>>3.23.49, and in a script i have a simple SELECT statement. The > content > >>>>is in the database, the query executes successfuly, but it's as if > >>>>mysql_fetch_array and mysql_fetch_row functions don't return anything. > >>>>I know mysql support is built-in (as indicated on php.net) and > working, > >>>>because i was able to use php to insert data into the database. On > that > >>>>one computer i was able to recreate the problem consistently and in no > >>>>situation would mysql_fetch array or _row return anything. > >>>> > >>>>I haven't had the opportunity to try this on any other win2k boxen, > but > >>>>am 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 > >>>> > >>>> > >>>> > >>> > >>> > >> > >> > >> > > > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php