Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Agh not displaying!


Message #1 by Empier4552@a... on Fri, 17 Aug 2001 21:57:45 EDT
Did you try running the SQL query from the MySQL command line to make sure
the query is returning a result?

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: <Empier4552@a...>
To: "professional php" <pro_php@p...>
Sent: Friday, August 17, 2001 9:57 PM
Subject: [pro_php] Agh not displaying!


>
> Alright I have a problem. below is a code i have above the <HTML> tag it
> should connect to the database, find the table, pull the requested
> information and then later on in the html area echo out the results
> <?
> $db_name = "empier";
> $table_name = "kiamembers";
>
> $connection = @mysql_connect("localhost", "******", "******") or
> die("Couldn't connect.");
>
> $db = @mysql_select_db($db_name, $connection) or die("couldnt select
> database");
>
> $sql = "SELECT cqchandle, email FROM $table_name WHERE cqchandle 
> \"$cqchandle\"
> ";
>
> $result = @mysql_query($sql,$connection) or die("Couldnt execute");
>
> while ($row = mysql_fetch_array($result)) {
>
> $cqchandle = $row['cqchandle'];
> $email = $row['email'];
>
> }
>
> ?>
>
> This part goes with out a hitch or so it seems no errors hitting..later
down
> i have it do the following:
>
> Below is the information for <? echo $cqchandle ?>
> Email: <? echo $email ?>
>
> but it gives me blanks instead. and I know this info is there.
>
> can anyone tell me whats wrong?

  Return to Index