MySQL Forums
Forum List  »  PHP

Connects but no data returned!
Posted by: Mani Gill
Date: December 18, 2005 09:48AM

Hi,

Im using MySQL 5.0 and PHP 5 (on IIS) and am having great problems when running simple SELECT queries in PHP. When testing the connection using:

<?php
$conn = mysql_connect("localhost", "root", "tw197td");
echo $conn;

?>

I get "rescource ID #1" as expected, but when running a basic SELECT query:

$connection = mysql_connection($host, $user, $pw)
or die("Couldnt Connect");

$db = mysql_select_db($database, $connection)
or die("Couldnt Connect");

$query = "SELECT * FROM customer";
$result = mysql_query($query)
or die ("Couldnt execute query");
$row = mysql_fetch_array($result);
extract($row);

echo "The Name is $firstName";


I get a blank page. Ive tried doing a variety of queries and all return a blank page.. Im come to a point where I am well and truely stuck!

Any help will be much appreciated.

many thanks

Options: ReplyQuote


Subject
Written By
Posted
Connects but no data returned!
December 18, 2005 09:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.