Php and mysql can someone help me out?
Posted: Tue Sep 27, 2005 11:20 pm
feyd | Please use
i cant seem to figure out why this wont work i am trying to compare two rows in my data base like......example my tables values are 'john' 'jane'
cool 1
nice 0
how do i make so that if jane=1 then echo cool then go to the next row and check the same thing??
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]Code: Select all
<?php
require('db_connect.php');
$db_object->setFetchMode(DB_FETCHMODE_ASSOC);
$result = mysql_query( "SELECT on_sale FROM productinfo" )
or die("SELECT Error: ".mysql_error());
$result1 = mysql_query( "SELECT product_image FROM productinfo" )
or die("SELECT Error: ".mysql_error());
echo "<table border=\"1\">";
while ($get_query = mysql_fetch_row($result)){
while ($get_query1 = mysql_fetch_row($result1)){
echo "<tr>";
foreach ($get_query as $rows){
foreach ($get_query1 as $rows1){
if ($rows == 1) {
echo "<td>$rows1</td>";
}
}
}
}
echo "</tr>";
}
echo "</table>";
$db_object->disconnect();
?>cool 1
nice 0
how do i make so that if jane=1 then echo cool then go to the next row and check the same thing??
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]