Posted: Tue Oct 05, 2004 12:43 pm
Well I certainly appreciate your help. I will keep working on this. There's another query on that page that I can modify and see what kind of results it produces.
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
echo $r;Code: Select all
$r = mysql_query ($query);
$row = mysql_fetch_assoc($r);Code: Select all
$query = "SELECT * FROM somewhere";
$result = mysql_query($query) or die (mysql_error())
$num_rows = mysql_num_rows($result)
// now conditionally get the resultset
if ($num_rows >= 1)
{
// theres a resultset
while ($array = mysql_fetch_array($result))
{
print {$array['something']};
}
}
else
{
// theres no results
print "No Matches Found";
}Code: Select all
print "<pre>";
print_r($array);
print "</pre>";Result of echoing cdickson's query is:SELECT * FROM Login_users a INNER JOIN orders b ON b.userid = a.userid WHERE b.date = '10-05-2004' ORDER BY b.order_no
SELECT * FROM orders, Login_users WHERE orders.date = '10-05-2004' ORDER BY orders.order_no ASC
Code: Select all
$date = $row['date'];
$date_arr = explode('-', trim($date));
$order_date = ($date_arr[1].'-'.$date_arr[2].'-'.$date_arr[0]);Code: Select all
<select name="selectdate">
<?php
do {
?>
<?php
//Convert order date format
$date = $row3['date'];
$date_arr = explode('-', trim($date));
$order_date = ($date_arr[1].'-'.$date_arr[2].'-'.$date_arr[0]);
?>
<option value="<?php echo $order_date; ?>"><?php echo $order_date; ?></option>
<?php
} while ($row3 = mysql_fetch_assoc($result3));
$rows = mysql_num_rows($result3);
if($rows > 0) {
mysql_data_seek($result3, 0);
$row3 = mysql_fetch_assoc($result3);
}
?>
</select>