Problema afisare date din db
Scris: Dum Oct 03, 2010
Buna am si eu o problema cu urmatorul cod:
Problema incepe de la:
Eu as vrea ca sa arate color din baza de date care o seteaza vizitatorul dar el imi da erroare cand intru pe site: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/hosting/gamestime/site-search.co.cc/search.php on line 86
Pls cum as putea sa fk sa arate culoarea din baza de date??ms
Cod: Selectaţi tot
<?php
$cuvant=$_GET['q'];
if($cuvant == NULL || $cuvant == '') {echo "<br>Sorry but you did not write any word";}
$conn = mysql_connect("localhost", "cautari", "cautari")
or die("Unable to connect to MySQL");
$selectdb = mysql_select_db('cautari');
$interogare = "SELECT * FROM siteuri_en WHERE cuvinte_cheie LIKE '%$cuvant%' OR descriere_site LIKE '%$cuvant%' ";
$rezultat = mysql_query($interogare);
if (mysql_errno()) {
echo "<br />". mysql_errno(). " : ". mysql_error(). "<br />";
}
$nr_campuri = mysql_num_fields($rezultat);
if (mysql_num_rows($rezultat) == 0) {
echo '<br><br>Your search - <b>'.$cuvant.'</b> - did not match any result.<br><br>
Suggestions:<br><br>
*Make sure all words are spelled correctly.<br>
*Try different keywords.<br>
*Try more general keywords<br>';
}
else {
while ($rand = mysql_fetch_assoc($rezultat)) {
echo '<br><table>
<tr>
<td></td><td align="left"><font size="5"><a href="'.$rand['link_site'].'" target="_blank">'.$rand['nume_site'].'</a></font><br><font color="<?php $ip = $_SERVER['REMOTE_ADDR'];
$conn = mysql_connect("localhost", "cautari", "cautari")
or die("Unable to connect to MySQL");
$selectdb = mysql_select_db('cautari');
$utilizator=mysql_real_escape_string($_GET['utilizator']);
$cerereSQL = 'SELECT * FROM design WHERE ip="'.$ip.'"';
$rezultat = mysql_query($cerereSQL);
if(mysql_num_rows($rezultat) > 0) {
while($rand = mysql_fetch_array($rezultat)) {
echo ''.$rand['culoare_descriere'].'';
}
}?>" size="4">'. str_replace($cuvant, '<u><b>'.$cuvant.'</b></u>', $rand['descriere_site']). '</font><br><font color="red" size="4">'.$rand['link_site'].'</font><br></td>
</tr><tr>
<td><font size="1pt"></font></td><td align="right"></td>
</tr><tr>
<td align="center" colspan="2">
</tr>
</table>';
}
}
?>
Cod: Selectaţi tot
<font color="<?php $ip = $_SERVER['REMOTE_ADDR'];
$conn = mysql_connect("localhost", "cautari", "cautari")
or die("Unable to connect to MySQL");
$selectdb = mysql_select_db('cautari');
$utilizator=mysql_real_escape_string($_GET['utilizator']);
$cerereSQL = 'SELECT * FROM design WHERE ip="'.$ip.'"';
$rezultat = mysql_query($cerereSQL);
if(mysql_num_rows($rezultat) > 0) {
while($rand = mysql_fetch_array($rezultat)) {
echo ''.$rand['culoare_descriere'].'';
}
}?>" size="4">
Pls cum as putea sa fk sa arate culoarea din baza de date??ms