Jump to content

Seorniyc

New Members
  • Posts

    2
  • Joined

  • Last visited

Seorniyc's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for reply ; Dear Ginerjm ; Im newbie on php. I try build myself but always missing something. Then i search my mistakes i found this code. I add multiple search conditions , change it for my needs. Now only need str_replace for spaces.. Dear Jacques1; I add a1 define for try. But i cant use a1 on $s3 line. search work with '%%%s%%' , i change that to a1 that give error on this line. $S3 = sprintf("Orj_P_N like '%%%s%%'",mysql_real_escape_string($search));
  2. Hi ; I have problem with search script ; This is code ; $search_form = "<form method='get' action='' ><span class='aktif'>Arama</span><input class='aktif' type='text' name='search' ><input class='aktif' type='submit'></form>"; echo $search_form ; $search = isset($_GET['search']) ? trim($_GET['search']): ''; $a1=(str_replace(' ', '',$search) ); $S1 = ' '; $S2 = ' '; $S3 = ' '; if($search != ''){ // Terimlerin Arama Kısmı $S1 = sprintf("WHERE Tetik_Ref like '%%%s%%' OR ",mysql_real_escape_string($search)); $S2 = sprintf("Marka_Model like '%%%s%%' OR",mysql_real_escape_string($search)); $S3 = sprintf("Orj_P_N like '%%%s%%'",mysql_real_escape_string($search)); } //Verilerin yazdırılma işlemi $main_query = "SELECT * FROM ats_motor $S1 $S2 $S3 "; $count_query = "SELECT COUNT(*) FROM ats_motor $S1 $S2 $S3 "; Orj_P_N column inside Original Part Numbers. Its same of "111 11 111" or "15K 1245 45" etc. When i search exact records work fine. But I search 11111111 nothing found. I search that and find str_replace function. But i cant use that. Cant import. I try change line 8 and 14. it give me error. Can anybody help me ? Thanks.
×
×
  • 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.