Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

no mysqli rows?

$
0
0

Hi, im trying to echo mysqli results into my form fields, but nothing appears.  

 

Is this because my query is not returning any results (im expecting results), or I have I missed something here?

$mysqli = new mysqli('');

if ($mysqli->connect_error) {
    die('Connect Error: ' . $mysqli->connect_error);
}

$query = "SELECT description, time, course, horse, odds1, odds2, place FROM toptips WHERE date='$newdate' AND horse='$horse'"; 
$result = $mysqli->query($query);

while($row = mysqli_fetch_array($result))
  {
$description = $row['description'];
$time = $row['time'];
$course = $row['course'];
$horse = $row['horse'];
$odds1 = $row['odds1'];
$odds2 = $row['odds2'];
$place = $row['place'];
  }

?>

<form action="edit_tip_action.php" method="post"><br/>
<input type="hidden" value="<?php echo $id ?>" />
<div class="formtitle">Time<div/>  <input name="time" type="text" value="<?php echo $time; ?>" /><br/>
<div class="formtitle"><Br/>Course<div/><input name="course" type="text" value="<?php echo $course; ?>" /><br/>
<div class="formtitle"><Br/>Horse<div/><input name="horse" type="text" value="<?php echo $horse ;?>" /><br/>
<div class="formtitle"><br/>Odds<div/>  <input name="odds1" type="text" size="1" value="<?php echo $odds1 ;?>" /> / 
<input name="odds2" type="text" size="1" value="<?php echo $odds2 ;?>" /><br/>
<div class="formtitle"><br/>Place</div><input name="place" type="text" value="<?php echo $place ;?>" /><br/>
 Note: ew or Win (capital W)<br/><br/>
Description<br/><textarea rows="4" cols="50">
<?php echo $description ?>
</textarea>
<input type="submit" value="Submit">
</form>

Viewing all articles
Browse latest Browse all 13200

Trending Articles