$sql=mysql_query(“SELECT * FROM searchengine”);
while (list($id, $title, $description, $url, $keywords)=mysql_fetch_row($sql))
{
//code…
}
This is faster than the one in the tutorial, because mysql_fetch_assoc() is slower than mysql_fetch_row() because of the associative array that creates. Moreover you don’t have to use an extra line ($keywords=$getrow['keywords']) for each variable.
Comment by bodhi1985 on March 16, 2010 at 2:33 pm
Where is the tutorial explaining associative array?
Comment by jasleenk86 on March 16, 2010 at 3:21 pm
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:xampphtdocsxamppsearchenginesearch.php on line 37
No result found.
Comment by jasleenk86 on March 16, 2010 at 4:10 pm
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:xampphtdocsxamppsearchenginesearch.php on line 37
No result found. plz help me to sort this error
Comment by mactop90 on March 16, 2010 at 5:03 pm
hey why when i type anything it it shows the phpacdemy and yahoo not google
Comment by punxz18 on March 16, 2010 at 5:25 pm
Question: is this gonna work for one table only? what if i have multiple tables?
Comment by punxz18 on March 16, 2010 at 6:21 pm
check your parameter
Comment by H3dQ on March 16, 2010 at 7:06 pm
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:UsersRootxampphtdocssearch.php on line 21
Huh?
Comment by AnimationShorts1 on March 16, 2010 at 7:25 pm
Good video tuts!
Comment by mikedhane on March 16, 2010 at 8:13 pm
how to we search more than one field. What if i wanted to search for someting in a state or city
Comment by JamesRCoston on March 16, 2010 at 8:21 pm
Midlandsbassline, are you on of those guys that trolls videos and finds things to moun about?
Comment by TommyDean1 on March 16, 2010 at 8:39 pm
try mysql_fetch_array($query)
Comment by matrix001m on March 16, 2010 at 9:24 pm
hiiiii …
thanks i have created “Add to cart scriptt” but it was nt worked ..
please help me out for this script..
?can u make a script of add to cart…
Comment by harmor20 on March 16, 2010 at 10:18 pm
Put the “explode” function above the while loop to cut down on page execution time.
Comment by khuram855 on March 16, 2010 at 10:55 pm
thanks
Comment by Midlandsbassline on March 16, 2010 at 11:16 pm
There is an error with your mysql string the SELECT * FROM …. that part
you before you run the while loop do this
if(!is_resource($get)){die(‘ERRO: SQL SYNTAX’);}
// do while loop here
Comment by Midlandsbassline on March 16, 2010 at 11:30 pm
This is n ot easy dood, Its done with javascript/ DOM Events and an Xhtml Object, you need to have a php script that will just return the data need to populate the list and then you need the javascript to track what letters the user is inserting, as the user inserts one more letter than the javascript will tell the other file what the user is typing and return possible matches to the DOM / javascript code then use the result to populate a box under the input area !
Comment by Midlandsbassline on March 17, 2010 at 12:02 am
Doo your shit lol atleast use mysql_real_escape_string so these young ones dont get hacked left right and center.. if you dont do security i suggest you learn it before u show tutorials.. and your phpBB tuts are putting all users at risk man…. learn the security before you carry on
Comment by matrix001m on March 17, 2010 at 12:08 am
hiiii thk alex…
can u make a search style like google
if we type a letter in textbox automatically
it can appear… means
“a list will open when me type some thing ….
please help me out for this…
Comment by khuram855 on March 17, 2010 at 12:38 am
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
what is that i do everything write but its says that why
Comment by socomglitchmasta on March 17, 2010 at 1:32 am
I have created an ADD-ON to this script which allows users to add their own search terms. Please message me for the link!
Comment by omanoman98 on March 17, 2010 at 1:49 am
Many thanks Alex for this lovely tut!
Comment by chjustin69 on March 17, 2010 at 2:08 am
Thanks for another create series!!!
About this blog
This blog is dedicated to showcasing great web design as well as providing advice and tips to any aspiring web designers out there. Hopefully these articles will aid you in your design and development.
23 comments
Comment by lnorby06 on March 16, 2010 at 2:29 pm
For the author:
$sql=mysql_query(“SELECT * FROM searchengine”);
while (list($id, $title, $description, $url, $keywords)=mysql_fetch_row($sql))
{
//code…
}
This is faster than the one in the tutorial, because mysql_fetch_assoc() is slower than mysql_fetch_row() because of the associative array that creates. Moreover you don’t have to use an extra line ($keywords=$getrow['keywords']) for each variable.
Comment by bodhi1985 on March 16, 2010 at 2:33 pm
Where is the tutorial explaining associative array?
Comment by jasleenk86 on March 16, 2010 at 3:21 pm
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:xampphtdocsxamppsearchenginesearch.php on line 37
No result found.
Comment by jasleenk86 on March 16, 2010 at 4:10 pm
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:xampphtdocsxamppsearchenginesearch.php on line 37
No result found. plz help me to sort this error
Comment by mactop90 on March 16, 2010 at 5:03 pm
hey why when i type anything it it shows the phpacdemy and yahoo not google
Comment by punxz18 on March 16, 2010 at 5:25 pm
Question: is this gonna work for one table only? what if i have multiple tables?
Comment by punxz18 on March 16, 2010 at 6:21 pm
check your parameter
Comment by H3dQ on March 16, 2010 at 7:06 pm
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:UsersRootxampphtdocssearch.php on line 21
Huh?
Comment by AnimationShorts1 on March 16, 2010 at 7:25 pm
Good video tuts!
Comment by mikedhane on March 16, 2010 at 8:13 pm
how to we search more than one field. What if i wanted to search for someting in a state or city
Comment by JamesRCoston on March 16, 2010 at 8:21 pm
Midlandsbassline, are you on of those guys that trolls videos and finds things to moun about?
Comment by TommyDean1 on March 16, 2010 at 8:39 pm
try mysql_fetch_array($query)
Comment by matrix001m on March 16, 2010 at 9:24 pm
hiiiii …
thanks i have created “Add to cart scriptt” but it was nt worked ..
please help me out for this script..
?can u make a script of add to cart…
Comment by harmor20 on March 16, 2010 at 10:18 pm
Put the “explode” function above the while loop to cut down on page execution time.
Comment by khuram855 on March 16, 2010 at 10:55 pm
thanks
Comment by Midlandsbassline on March 16, 2010 at 11:16 pm
There is an error with your mysql string the SELECT * FROM …. that part
you before you run the while loop do this
if(!is_resource($get)){die(‘ERRO: SQL SYNTAX’);}
// do while loop here
Comment by Midlandsbassline on March 16, 2010 at 11:30 pm
This is n ot easy dood, Its done with javascript/ DOM Events and an Xhtml Object, you need to have a php script that will just return the data need to populate the list and then you need the javascript to track what letters the user is inserting, as the user inserts one more letter than the javascript will tell the other file what the user is typing and return possible matches to the DOM / javascript code then use the result to populate a box under the input area !
Comment by Midlandsbassline on March 17, 2010 at 12:02 am
Doo your shit lol atleast use mysql_real_escape_string so these young ones dont get hacked left right and center.. if you dont do security i suggest you learn it before u show tutorials.. and your phpBB tuts are putting all users at risk man…. learn the security before you carry on
Comment by matrix001m on March 17, 2010 at 12:08 am
hiiii thk alex…
can u make a search style like google
if we type a letter in textbox automatically
it can appear… means
“a list will open when me type some thing ….
please help me out for this…
Comment by khuram855 on March 17, 2010 at 12:38 am
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
what is that i do everything write but its says that why
Comment by socomglitchmasta on March 17, 2010 at 1:32 am
I have created an ADD-ON to this script which allows users to add their own search terms. Please message me for the link!
Comment by omanoman98 on March 17, 2010 at 1:49 am
Many thanks Alex for this lovely tut!
Comment by chjustin69 on March 17, 2010 at 2:08 am
Thanks for another create series!!!