Jump to content

"Resource id #12" issue


Guest

Recommended Posts

Hi there,

 

I have a problem with a query:

<?php 
$sql = "SELECT SUM(room_fee) FROM function_room WHERE event_id = '$sel_event[id]'";
$result = mysql_query($sql);
echo "$result";
?>

 

When I perform this query in phpMyAdmin, I get the number I want but when I put that in one of the pages of my website, I get a "Resource id #12" instead.

 

Any idea what I did wrong?

 

Thanks for your answers.

 

Cheers,

Link to comment
https://forums.phpfreaks.com/topic/183133-resource-id-12-issue/
Share on other sites

Actually, I found the solution right after posting here. Here is what I did if it can help some people:

<?php 
$sql = "SELECT SUM(bedroom_total) FROM bedrooms WHERE event_id='$sel_event[id]'";
$result = mysql_query($sql);
$r = mysql_fetch_row($result);
echo "$r[0]";
?>

 

Thanks anyway! :)

Link to comment
https://forums.phpfreaks.com/topic/183133-resource-id-12-issue/#findComment-966493
Share on other sites

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.