Jump to content

Recommended Posts

function get_inc(){
$clutches = "SELECT * FROM cluth WHERE uid = '$id'";
$clu = mysql_query($clutches)or die(mysql_error());
$result = mysql_fetch_array($clu,MYSQL_ASSOC);
$i = 1;
echo "<tr><td>Number.</td><td>clutch Size.</td><td>Worth</td></tr>";
while($result = mysql_fetch_array($clu,MYSQL_ASSOC)){
$cid = $result['id'];
$sire = $result['sire'];
$dame = $result['dame'];
$datel = $result['date_layed'];
$size = $result['size'];
$price = $result['price'];
echo "<tr><td>$i.</td><td>
<a href=\"?room&height=350&width=520&modal=true\" 
class=\"thickbox\" title=\"$sire+$dame\">
($size) Egg Clutch</a>
</td><td>$price</td></tr>";
$i++;
} 

}

 

Link to comment
https://forums.phpfreaks.com/topic/241292-anything-wrong-with-this-query/
Share on other sites

function get_inc(){
$clutches = "SELECT * FROM cluth WHERE uid = '$id'";
$clu = mysql_query($clutches)or die(mysql_error());
echo "<tr><td>Number.</td><td>clutch Size.</td><td>Worth</td></tr>";
$i = 1;
while($result = mysql_fetch_array($clu,MYSQL_ASSOC)){ //result_type is not needed but is fine as-is
$cid = $result['id'];
$sire = $result['sire'];
$dame = $result['dame'];
$datel = $result['date_layed'];
$size = $result['size'];
$price = $result['price'];
echo "<tr><td>$i.</td><td>";
<a href=\"?room&height=350&width=520&modal=true\"  
class=\"thickbox\" title=\"$sire+$dame\">
($size) Egg Clutch</a>
</td><td>$price</td></tr>";
$i++;
} 

}

only thing I changed is the redundancy of the $result variable

you can also echo $i++ instead of $i

whats going on with your href?

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.