Witam, długo czasu szukałem takiego skryptu aż w końcu znalazłem. Jest to autosugestia mniej wiecej taka jaką mamy teraz w googlach.
Chce ten skrypt wykorzystać do podpowiadań adresów IP i emaili w moim panelu. Jadnak mam jeden problem bo poprzerobieniu skryptu na moje potrzeby pojawił się jakiś błąd z którym nie mogę sobie sam porawdzić.
Oto kod :
<?php
if(!$db) {
echo 'Could not connect to the database.'; } else {
if(isset($_POST['queryString'])) { $abc = $_POST['queryString'];
$query = mysql_query("SELECT country FROM countries WHERE country LIKE '$queryString%' LIMIT 10"); if($query) {
while ($result = $query ->fetch_object()) {
echo '<li onClick="fill(\''.addslashes($result->country).'\');">'.$result->country.'</li>'; }
} else {
echo 'OOPS we had a problem :('; }
} else {
// do nothing
}
} else {
echo 'There should be no direct access to this script!'; }
}
?>
A tutaj jest oryginalny kod pliku:
<?php
$db = mysql('localhost', 'root' ,'', 'kraje');
if(!$db) {
echo 'Could not connect to the database.'; } else {
if(isset($_POST['queryString'])) { $queryString = $db->real_escape_string($_POST['queryString']);
$query = $db->query("SELECT country FROM countries WHERE country LIKE '$queryString%' LIMIT 10");
if($query) {
while ($result = $query ->fetch_object()) {
echo '<li onClick="fill(\''.addslashes($result->country).'\');">'.$result->country.'</li>'; }
} else {
echo 'OOPS we had a problem :('; }
} else {
// do nothing
}
} else {
echo 'There should be no direct access to this script!'; }
}
?>
Mój problem jest takiej natury:
http://imageshack.us/photo/my-images/37/problemmm.png/Bardzo proszę o pomoc.