Firstly, cross-posting like this is a huge
no-no, please don't do that again.
> When the script runs it displays Array.
Printing arrays directly will do that. Logically
speaking, how do you expect PHP to know what
value to get here? You are SELECTing many.
> I am running WIN2K and IIS 5
I'm sorry ;)
> echo "Camp Street Cafe";
>
> Here is the script that is called.
>
>
> $db = mysql_connect("localhost", "", "")
> or die ("Could not connect to Localhost");
> mysql_select_db ("ETM", $db)
> or die ("Could not connect to the Database");
If you start running into problems, please
consider mysql_error()
> $table = "locations";
> $location = ($_REQUEST["location"]);
No need for the () here.
> $query = "Select * from $table where Location_ID = $location";
Notice how you're selecting many columns here, not just one.
> $result= mysql_query($query);
> $Location_Info = mysql_fetch_row($result);
Looking in the manual, the entry for mysql_fetch_row
tells us:
mysql_fetch_row -- Get a result row as an enumerated array
array mysql_fetch_row ( resource result)
So it returns an array. If you prefer the _row format
then continue to use it, for example using list():
list($id, $name, $email) = mysql_fetch_row($result);
Or just:
$row = mysql_fetch_row($result);
print $row[0]; // This is an enumerated array (numerical)
print $row[1];
Or use a function like mysql_fetch_assoc instead:
$row = mysql_fetch_assoc($result);
print $row['id']; // with id being a column name
// selected via the query
print $row['name'];
And lastly, if you're not going to use all the data,
don't SELECT * of it.
Good start, keep it going :)
Regards,
Philip Olson
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php