oops slight mistake i noticed there..
should be
thats because mysql_fetch_row only returns one row.
to get all the rows do
while ($row = mysql_fetch_array($result)) {
$firstcloumn = $row[0];
}
This will run through all the rows putting the colunms into the array $row[]
Regards
Jon
--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07968 524175
PGP Key available, send blank email to [EMAIL PROTECTED]
-----Original Message-----
From: Jeremy Morano [mailto:[EMAIL PROTECTED]]
Sent: 14 August 2001 15:53
To: [EMAIL PROTECTED]
Subject: [PHP] Select
Hi,
I'm having a problem with my Select statement. This is what i'm doing:
$connection = @mysql_connect("l", "c", "c") or die("Couldn't connect.");
$db = @mysql_select_db($db_name, $connection) or die("Couldn't select
database.");
$sql =" SELECT *
FROM table_1
";
$result = @mysql_query($sql,$connection) or die("Couldn't execute query.");
$data=mysql_fetch_row($result);
$count=$data[0];
echo $count;
Yet the only result I get is the first value of the first
column.............
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]