mimoser
asked on
SQL Query Not Displaying On Page
For the life of me, trying various methods, I can't get the $Bux value to display on the page
The only thing that appears in the cell are ..
Please help!!!
The only thing that appears in the cell are ..
Please help!!!
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
mysql_select_db($db) or die ("Unable to select database!");
$query = "select p.GiftID, p.GiftName, p.GiftURL
from voc2_users_gift up
inner join voc2_gift p on p.GiftID = up.GiftID
where up.id = 1";
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
$query = "select Bux
from voc2_bux
where id = 1";
if (mysql_num_rows($result) > 0)
?>
Profile Example
<br>
<table border="1"
width="69%"
bordercolorlight="#00FF00"
bordercolordark="#00FF00"
bgcolor="#000000"
id="table1"
height="164">
<tr><td>
<table border="1"
width="100%"
bgcolor="#000000"
bordercolor="#00FF00"
id="table1"
height="222">
<tr>
<td width="481" height="33">
<p align="center">
<b><font color="#FFFFFF">Most Recent Gifts</font></b>
</p>
</td>
<td height="33" width="107">
<p align="center">
<b><font color="#FFFFFF">
<a href="gift.htm" style="font-style: italic">
<font color="#FFFFFF">Show All Gifts</font>
</a>
</font></b>
</p>
</td>
<td height="33">
<p align="center">
<font color="#FFFFFF"><b><?=".$Bux."?></b></font>
</p>
</td>
</tr>
<tr>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It still isn't showing the value of $Bux in that cell. It appears blank, but there is information in that table field, it's just rendering onto the page.
What else can I try?
What else can I try?
$connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!");
mysql_select_db($db) or die ("Unable to select database!");
$query = "select p.GiftID, p.GiftName, p.GiftURL from voc2_users_gift up inner join voc2_gift p on p.GiftID = up.GiftID where up.id = 1";
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
$query2 = "select Bux from voc2_bux where id = 1";
$result2 = mysql_query($query2);
$bux = mysql_fetch_array($result2);
if (mysql_num_rows($result) > 0)
?>
Profile Example
<br>
<table border="1"
width="69%"
bordercolorlight="#00FF00"
bordercolordark="#00FF00"
bgcolor="#000000"
id="table1"
height="164">
<tr><td>
<table border="1"
width="100%"
bgcolor="#000000"
bordercolor="#00FF00"
id="table1"
height="222">
<tr>
<td width="481" height="33">
<p align="center">
<b><font color="#FFFFFF">Most Recent Gifts</font></b>
</p>
</td>
<td height="33" width="107">
<p align="center">
<b><font color="#FFFFFF">
<a href="gift.htm" style="font-style: italic">
<font color="#FFFFFF">Show All Gifts</font>
</a>
</font></b>
</p>
</td>
<td height="33">
<p align="center">
<font color="#FFFFFF"><b><?=$Bux?></b></font>
</p>
</td>
</tr>
<tr>
ASKER
I found an corrected an error
$bux = mysql_fetch_array($result2 );
to
$Bux = mysql_fetch_array($result2 );
and now in the cell when I call for the $Bux data -
<font color="#FFFFFF"><b><?php echo "$Bux"; ?></b></font>
It's showing the word - Array
Please help!!
$bux = mysql_fetch_array($result2
to
$Bux = mysql_fetch_array($result2
and now in the cell when I call for the $Bux data -
<font color="#FFFFFF"><b><?php echo "$Bux"; ?></b></font>
It's showing the word - Array
Please help!!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window