Jump to content
php.lv forumi

sintakses errors


anonīms

Recommended Posts

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''komandas' WHERE LIKE..

 

 

if(isset($_POST['meklet']))
{
$meklet = quote_smart($_POST['meklet']);
$tabula = quote_smart($_POST['tabula']);


if($tabula == 'lietotaji') { $kas = 'lietotajvards'; } elseif($tabula == 'komandas') { $kas = 'komandas_nosaukums'; } else { $kas == 'raksts_visraksts'; }

$mekletajs = mysql_query("SELECT * FROM $tabula WHERE $kas LIKE $meklet") or die(mysql_error());
while($atrasts = mysql_fetch_array($mekletajs))
{

}
echo "SELECT * FROM $tabula WHERE $kas LIKE $meklet";
echo "<br /><br />BETA!";
}
else 
{
echo '
<form method="post" action="search.php">
<select name="tabula">
<option value=\'jaunumi\'>'.$lang['izvelne_jaunumi'].'
<option value=\'lietotaji\'>'.$lang['profils_lietotaji'].'
<option value=\'komandas\'>'.$lang['komandas_komandas'].'
</select><br />
<input type="text" name="meklet" /><br />
<input type="submit" value="'.$lang['meklet'].'" />
</form>';
}

 

Kas par vainu? :\

Link to comment
Share on other sites

×
×
  • Create New...