Hi
This is what I always do...
1. for one row (saved in array $reihe)...
$bla = "SELECT * FROM table WHERE id = '$something''';
// db is your database connection
$test = mysql_query($bla, $db);
// you dont have to use the if...i do that to check if anything
was returned
if ($reihe = mysql_fetch_row($test))
{
echo $reihe[0] . $reihe[1];
}
//this will output field one and two of the queried row
2. to get several rows in an array:
$bla = "SELECT * FROM table''';
// db is your database connection
$test = mysql_query($bla, $db);
while ($reihe = mysql_fetch_array($test))
{
echo $reihe[0];
}
//this will output the first field of all rows in this table
- Nessi -
(heh my first contribution to the mailing list! woohooo) ;)))
At 14:32 23/05/01 +0100, you wrote:
>ok...sorry to ask a stupid question but....
>
>$result = mysql_query("SELECT jazz FROM funk WHERE foo='bar'")
>
>but where do you go from there. How would you iterate through the array a
>row at a time, doing your thing as you go along?
>
>thanks,
>
>jamie
>
>
>--
>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]