Jump to content

search page and stuff


dri

Recommended Posts

hi all this is my first post hope i learn good stuff from the forum 

 

so my problem is i am making a search page that well search in my mysql database i have 3 problems now

 

1

$sql = mysql_query("select * from remote where topic like '%$term%'");

 

this is used as for a search page

this well search in table remote i want to add more than that table i wanna add

 

4 more so total 5

and all searching in the same column (topic) how can i do that

 

 

2

if i entered ' in the search box i get an error that means its hackable

how can i fix that if u need the full source code just till me

this is the error

 

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in E:\wamp\www\website\searcher.php on line 61

this is line 61 while ($row = mysql_fetch_array($sql)){

 

3

so now i have 2 files for the search page 1 is .html and 2 is .php

if i entered .php without going to .html and type any thing in the search bar i well get an error Notice: Undefined index: term in E:\wamp\www\website\searcher.php on line 58

 

and in line 58 $term = $_POST['term'];

how can i add a command that if there is nothing in term it well show nothing in result

 

 

 

 

 

 

thats all hope u guys help me making a bid site need a search page 

 

 

i am really beginner at this so i may ask allot even when the answer is in front of me 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.