Re: Problems getting data out from the database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Wed, 17 Aug 2005, Chin Yan Yan wrote:

I had try using the fetch arrays things or the fetch rows but it nv show
anything out. The ans and info are two different table but in the same
database. Below is the coding.

<?
$host='localhost';
$username='root';
$password='asd';
$connection = mysql_connect($host,$username,$password);
mysql_select_db("testing");

$ans = mysql_query ("select ans.choice from ans, info where
info.choice=ans.value;");

$numOfRows = mysql_num_rows ($ans);
$row = mysql_fetch_array($ans);


echo "$numOfRows <br>";//return num of rows
echo $row["ans.choice"];

echo $row[0] ;


this might work i guess ..
just type print_r($row) and check out how are the variables mapped


?>


--
*********************************************************************************************

	You wouldn't know an OS if it hit you in the face ...

						Linux Baby !

*********************************************************************************************

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux