I have this code: <?php echo $pinDetails->id;?>
this gives me a unique ID and displays it on my page.
I am trying to check whether this unique ID for one table is also in another table. Then if it is, show other data from that table.
<?php
$data = mysql_query("SELECT * FROM repin WHERE new_pin_id>$pinDetails->id")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
Print "".$info['from_pin_id'].",".$info['new_pin_id']."";
}
?>
To my understanding this should work fine but nothing appears. Do I have the syntax wrong?
Also, is there a cleaner way of doing this?