Problems getting data out from the database
| From: | Chin Yan Yan | Date: | Wed, 17 Aug 2005 01:40:55 +0000 |
| Subject: | Problems getting data out from the database | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-40089@lists.php.net to get a copy of this message | ||
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"];
?>