გამარჯობა.
საძიებო ველი მინდა დავაკავშირო ბაზასთან. ხოდა როგორც ამ ვიდეოშია აღწერილი, ისე ვაკეტEბ, მაგრამ რაღაც არ გამოდის:
https://www.youtube.com/watch?v=PBLuP2JZcEgრა მეშლება?
<?php
mysql_connect ("აქ სერვერს ვწერ", "აქ მომხმარებლის სახელს", "აქ პაროლს") or die ("could not connect");
mysql_select_db ("აქ მონაცემთა ბაზის სახელი") or die ("could not find db");
$output = '';
if (isset($_POST['search'])) {
$searchq = $_POST[search'];
$searchq = preg_replace("#[^0-9a-z]#i", "", $searchq);
$query = mysql_query ("SELECT * FROM ცხრილის სახელი WHERE ცხრილის გრაფის სახელი LIKE '%$searchq%' OR ცხრილის მეორე გრაფის სახელი LIKE '%$searchq%'") or die ("could not search");
$count = mysql_num_rows($query);
if ($count == 0) {
$output = 'There was no search results';
} else {
while ($row = mysql_fetch_array($query)) {
$fname = $row['ცხრილის გრაფის სახელი'];
$lname = $row['ცხრილის მეორე გრაფის სახელი'];
$id = $row['id'];
$output .= '<div>'.$fname.' '.$lname.'</div>';
}
}
}
?>
<!Doctype html>
<html>
<head>
<title>search</title>
</head>
<body>
<form action="search.php" method="post">
<input type="text" name="search" placeholder="suchen">
<input type="submit" value="suchen">
</form>
<?php print ("$output"); ?>
</body>
</html>
ასეთ ერორს აგდებს:
Parse error: syntax error, unexpected '']; ' (T_CONSTANT_ENCAPSED_STRING), expecting ']' in /home/vol15_6/0fees.us/0fe_16416157/htdocs/search.php on line 13
ვერ მივხვდი, რა უნდა.