function call
Posted: Wed Jan 19, 2005 5:05 pm
Hi
I have a bug in my php code I need help in. I have two text boxes that takes in 2 dates. A function then querries the db and returns the rows needed. With this I have a seperate display that will display the rows returned. All this works other than the display of number of rows returned. It will only return this after the 2nd time I press the submit button. I would like it to display on the first submit.
Here is the following code:
the php code is:
Thanks in advance
twb
I have a bug in my php code I need help in. I have two text boxes that takes in 2 dates. A function then querries the db and returns the rows needed. With this I have a seperate display that will display the rows returned. All this works other than the display of number of rows returned. It will only return this after the 2nd time I press the submit button. I would like it to display on the first submit.
Here is the following code:
Code: Select all
function querry_textboxs($datevariable1,$datevariable2){
$query = "Select DISTINCT * From calander WHERE task_date>='$datevariable1' AND task_date <= '$datevariable2'";
echo " ";
$result = mysql_query($query);
if(!$result){
echo "Error in search for results:".mysql_error();
//exit();
}
while ($row = mysql_fetch_array($result)){
echo '<tr>';
//Print Date
echo '<td align="center" width="110">'.$rowї'task_Date'].'</tr>';
//Print Task Time
echo '<td align="center" width="110">'.$rowї'task_time'].'</tr>';
//Print Task name
echo '<td align="center" width="110">' .$rowї'task_Name'].'</td>';
//Print Description
echo '<td align="left" width="200">' .$rowї'task_Description'] .'</td>';
}
if (!empty($result)){
$records_found = mysql_num_rows($result);}
return $records_found;
}Code: Select all
<?php
//querries textboxes
$records = querry_textboxs($val_from,$val_to);
// set to session }
$_SESSIONї'records_set'] = $records; ?>twb