renojim
-
Posts
2 -
Joined
-
Last visited
Never
Posts posted by renojim
-
-
Not new to programming, but an infant in PHP. I'm using the following code to get a value from a mySql table. The table has seven columns, one row, field Ronum is mediumint with a value of 1 in it and is the primary key. The following code runs fine, but when I get to the echo row/ronum at the bottom, $row contains only "ARRAY", and $ronum is blank. Don't get it.:
<?php
$user="root";
$host="localhost";
$password="";
$database = "Vshop";
$connection = mysql_connect($host,$user,$password)
or die ("couldn't connect to server");
$db = mysql_select_db($database,$connection)
or die ("Couldn't select database");
{
$query = "Select Ronum From ro";
}
$result = mysql_query($query)
or die ("Couldn't execute query.");
$row = mysql_fetch_array($result,MYSQL_NUM);
extract ($row);
echo "$row";
echo "$ronum";
?>
Any help is greatly appreciated.
Newbie - trouble getting data from database
in PHP Coding Help
Posted