Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Echo Query Recordset returning Null

Status
Not open for further replies.

WilliamMute

Programmer
Jan 4, 2006
117
Hi Again,

I beleive this will be my last question.

Am obviously having trouble again.
Could anyone please look at the code below to see if they can spot why I my echo statement is not showing anything despite the fact that there are information in both tables in my db?


$query_Recordset1 = "SELECT * FROM springrisecart, products WHERE (springrisecart.session) = '$cart_id' AND (springrisecart.product_id = 'products.id')";
$Recordset1 = mysql_query($query_Recordset1, $Connection) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);



Then my echo statement is this:

<td><span class="LoopRowsQuery2"><span class="LoopRowsQuery"><?php echo $row_Recordset1['product_price']; ?></span></span></td>
<td><img src="<?php echo "products/". $row_Recordset1['image']; ?>.jpg" alt="Your Product" height="25" width="28"></td>

Thanks again!

(ps: I dont know how you put your codes in those nice format when pasting it here so its easy to read. may be a tip bout that 2! fanks)
 
Are you sure your query is producing the output you're expecting? Try to echo out the query and then run it in your favourite database manager to check the output.

For the neat code block, use the code tags: [ignore]
Code:
Code in here
[/ignore].
 
Cheers for your response.

I tried runing it on my Database manager, it says " MySQL returned an empty result set"

Dont know how that can be, when there are clearly products on both DB's.

Thanks for the CODE tag tip as well.

Any other suggestions?
 
Hi again,

I tried Echoing out my sql query it brought out this

SELECT * FROM springrisecart, products WHERE (springrisecart.session) = '15c246a1b274c4052e0038ebc6396bbe' AND (products.id = 'springrisecart.product_id')

on my browser does this ring any bell as to what could be wrong?

Thanks
 
Got it working now, minor typo

error 'springrisecart.product_id' instead of 'springrisecart.product_id


Cheers anyway for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top