Jump to content

Strange output with the code included, please help understand!


Darkmatter5

Recommended Posts

I have a few variables with the following data:

 

$FirstName=joe;

$LastName=doe;

$Address=1 street;

$City=Austin;

$State=Texas;

$ZipCode=90210;

 

Here's the code I'm using

//after new client data is applied to clients table, display success message and display entered data from table to verify accuracy

$FNresult=mysql_query(sprintf("SELECT FirstName FROM byrnjobdb.clients WHERE FirstName='$FirstName' AND LastName='$LastName' AND Address='$Address' AND City='$City' AND State='$State' AND ZipCode='$ZipCode'"));

echo "NEW CLIENT ADDED...

The following is the data you entered to verify accuracy.

$FNresult";

 

Here is the output I recieve.

NEW CLIENT ADDED...

The following is the data you entered to verify accuracy.

Resource id #5

 

Why does it not say?

NEW CLIENT ADDED...

The following is the data you entered to verify accuracy.

joe

 

Help please!!

I have a few variables with the following data:

 

$FirstName=joe;

$LastName=doe;

$Address=1 street;

$City=Austin;

$State=Texas;

$ZipCode=90210;

 

Here's the code I'm using

//after new client data is applied to clients table, display success message and display entered data from table to verify accuracy

$FNresult=mysql_query(sprintf("SELECT FirstName FROM byrnjobdb.clients WHERE FirstName='$FirstName' AND LastName='$LastName' AND Address='$Address' AND City='$City' AND State='$State' AND ZipCode='$ZipCode'"));

echo "NEW CLIENT ADDED...

The following is the data you entered to verify accuracy.

$FNresult";

 

Here is the output I recieve.

NEW CLIENT ADDED...

The following is the data you entered to verify accuracy.

Resource id #5

 

Why does it not say?

NEW CLIENT ADDED...

The following is the data you entered to verify accuracy.

joe

 

Help please!!

 

$result = mysql_fetch_assoc($FNresult);

echo "NEW CLIENT ADDED...<br />The following is the data you entered to verify accuracy:<br />{$result['FirstName']}";

 

Use that.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.