Anthony,

> Although the table con_inf in db sbwresearch contains 3 records with
> username as the first column,  the following short script generates a blank
> page:
>
> <?php
> $connection=mysql_connect("localhost","wagner","xyz") or die ("No
> connection!");
> $db=mysql_select_db("sbwresearch",$connection) or die ("No database!");
> $qry_1="select * from con_inf";
> $result_1=mysql_query($qry_1,$connection) or die ("No query # 1!");
> while ($row_1=mysql_fetch_array($result_1,"mysql_assoc"))
> {
>    $username=$row_1["username"];
>    echo "$username";
> };
> mysql_free_result($result_1);
> mysql_close($connection);
> exit;
> ?>
>
> Why?  I've use the statement in other scripts and it works!


Please review http://www.php.net/manual/en/function.mysql-fetch-array.php. The second 
argument to
mysql_fetch_array is the name of a system-defined constant, not a string
(http://www.php.net/manual/en/language.constants.php).

Given the way you have coded this example, may I also suggest mysql_assoc() at
http://www.php.net/manual/en/function.mysql-fetch-assoc.php

Regards,
=dn



-- 
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]

Reply via email to