
table = "url_titles"
row = "title"
Po wpisaniu tytułu piosenki, zamiast wyszukać jedną pozycję, zwraca wszystko co znajduje się w row = "title".. U autora na stronie wszystko działa, podam linka:
Search Script
O to mój kod w którym na 100% mam coś nie tak skonfigurowane, gdyby mógł ktoś z was pomóc ...
<?php include ('naglowek.htm'); // Dolaczenie naglowka HTML. ?> <head> <link rel="stylesheet" type="text/css" href="includes\css.css"> </head> <html> <body> <font face="tahoma" size="4"> <font face="Verdana, Arial, Helvetica, sans-serif">Mysql Search</font></font> <font face="Verdana, Arial, Helvetica, sans-serif"> Specific Word or Phrase <br> <br> <input type="hidden" name="good" value="yes"> <input type="submit" value="Search"> </font> </form> <p><font face="Verdana, Arial, Helvetica, sans-serif"><br> <br> <? /* This script is set up specifically for me so some things will need changing. I made this script because there is a lack of good mysql serching scripts out th
ere. */ if($_POST['good']=='yes') { $location = "***"; // database host (localhost) $username = "***"; // mysql username $password = "***"; //mysql password $database = "****"; //mysql database name $db_table = "url_titles"; // mysql table name to search $mysql_row = "title"; // This is the row in your mysql database that you want to search for text in. $query = "ALTER TABLE $db_table ORDER BY id DESC"; $query = "SELECT * FROM $db_table"; { /* event_id event_date event_venue event_headline event_town are all rows in my mysql table. You must replace them with your own rows / rows */ $name = ($row[title]); $rawid = ($row[event_id]); $rawmonth = ($row[event_date]); //yes strange variable names. It works so it doesnt matter. $rawdate = ($row[event_venue]); //T just grab extra data to be added with the search tool $rawyear = ($row[event_headline]); $display = '<font face="tahoma" size="2"><b>' .$rawmonth . ' ' . $name. ' ' . $rawdate . ', ' . $rawyear . '</b><br>' . $newnews . '</font><br><br>'; $foundcount++; } $totalcount++; } echo("<font face=\"tahoma\" size=\"3\" color=\"green\"><b>Found $foundcount entries out of $totalcount</b></font>"); } ?> <br> A mysql searching tool made by <a href="http://www.gmtt.co.uk">gmtt.co.uk</a></font></p> <p> </p> <p><font face="Verdana, Arial, Helvetica, sans-serif"> the rows (event_date, event_venue etc etc) are used for<br> displaying extra information about the search result.</font></p> <?php include ('stopka.htm'); // Dolaczenie stopki HTML. ?>