Jump to content

Debugging Php Code


divadiva

Recommended Posts

Experts

 

I am going to ask the same question I asked yesterdat but this time I will be more precise.I did tried some debugging on myside,but I would appreciate your expert advice.

 

My system has on of the field named "Word"(basically a textbox).In this textbox you can enter a number or word and hit search.If there is any data present in database it will return the data.But the problem is that when I hit search I get an empty table.

 

I was debugging and found that somehow the system is duplicating the values I enter.Supposingly I enter 'a' in word column I get 'aa' in return.

 

Below is the code:

 

<% if ($swords){
										//print_r($_POST);
										//print_r($_GET);
								                 print $swords;   								print $swords;
									$fstring .= " AND ( `description` REGEXP '$swords' 
									OR `configuration` REGEXP '$swords' 
									OR `software` REGEXP '$swords' 
									OR `hardware` REGEXP '$swords' 
									OR `model` REGEXP '$swords' 
									OR `manufacturers` REGEXP '$swords' 
									OR `process` REGEXP '$swords' 
									OR `inventory_id` REGEXP '$swords' 
									OR `serial_number` REGEXP '$swords'
									OR `tool_id` REGEXP '$swords' )";
} else {									print 'N/A';

Link to comment
Share on other sites

$print sword  at the top is for check .I tried what you have sugegsted but didnt work.

 

I have another file "edit inventory" It uses same piece of code and works there.

 

Please help me on this.I will appreciate your suggestions.

 

Link to comment
Share on other sites

I tried that doesnt do any good .

 

Actuallt I have one more file "Edit Inventory" which uses same logic "WORD" works fine.But somehow this doesnt works.

 

Interestingly ,in the other file if I type print$swords it returns one alphabet whereas the file I am trying to debug returns duplicate values.Thats why I mentioned this point in one of my previous posts.

 

Cheers!

 

 

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.