Re: newbie mysql and php

From: Date: Sun, 28 Dec 2003 10:46:15 +0000
Subject: Re: newbie mysql and php
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-173396@lists.php.net to get a copy of this message
Hi, I fixed it, I have not realize that my database was not connected to a user. so when i logged as prog_tony dealer was not a member of prog_tony so it could not be found. thanks for the help "Tony" <awardd@essex.ac.uk> wrote in message news:20031227231753.14198.qmail@pb1.pair.com... > hello > > I'm new with php just learning and i have just a problem with the following > code > > $dbconnect = mysql_connect("localhost", "prog_tony","PASSWORD"); > mysql_select_db("prog_dealer", $dbconnect); > $stop = 0; > $counter = 1; > while(!$stop){ > $query = "SELECT name FROM category WHERE id = $counter"; > $dbdo = mysql_query($query,$dbconnect); > while($row= mysql_fetch_array($dbdo)){ > if($row[0]){ > $counter++; > }else{ > $stop=1; > } > $row[0] = ""; > } > > } > > > > I'm getting an error with mysql_fetch_array() which is line 14 because I > didn't show the other lines since it is not relevant. > here is the error > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result > resource in /home/prog/public_html/php/cateadded.php on line 14 > > Thank you

« previous php.general (#173396) next »