Thursday 15 September 2011

mysqli - PHP link in search results not working correct -



mysqli - PHP link in search results not working correct -

i have little problem, have been testing numbers of variants don´t work. have link in search result.. (full text search working)

> while($row = mysql_fetch_assoc($query)){ > > $id = $row['id']; > > echo '<a href=profile1.php?id= . $row["id"] . >.info.</a>';

it shows info link , when click on it, jump profile1.php i´m not seeing results, totaly blank page. url .../profile1.php?id=

here profile.php

<?php $mysqli = new mysqli("", "", "", ""); /* replace necessary info */ /* found connection */ if (mysqli_connect_errno()) { printf("connect failed: %s\n", mysqli_connect_error()); exit(); } $id=$_get["id"]; if ($stmt = $mysqli->prepare("select name, brand table id=?")) { $stmt->bind_param("d", $id); /* bind info query */ $stmt->execute(); /* execute query */ $stmt->bind_result($name, $brand); /* bind result variable */ $stmt->fetch(); /* fetch info */ printf("%s - %s", $name, $brand); /* echo info */ $stmt->close(); /* close statement */ } $mysqli->close(); ?>

i hope can help me.. thanks!!!

do .

echo "<a href=profile1.php?id=$row[id]>info</a>";

or this.

echo '<a href=profile1.php?id='.$row['id'].'>info</a>'

php mysqli

No comments:

Post a Comment