This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

get particular rows based on input form from mysql using php

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
trying to get all rows containing particular value based on input form from mysql database using php..for that i am using LIKE but shows only the column name ,can't able to fetch the related data ...
also tried with

display only column name..
any idea over here???

index.html
index.php
 
Sheriff
Posts: 6115
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

My PHP is rusty, but do you really want backticks around phpp?
 
surya preethaaa
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as per my knowledge it can be used with or without backticks..
 
surya preethaaa
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''%அகல்%' at line 1
where அகல் is the word i gave in text field
 
surya preethaaa
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the above post is the error i got..how to overcome this???
 
Knute Snortum
Sheriff
Posts: 6115
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

surya preethaaa wrote:as per my knowledge it can be used with or without backticks..


If the SQL table is called phpp, I would not use backticks.
 
Knute Snortum
Sheriff
Posts: 6115
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

surya preethaaa wrote:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''%அகல்%' at line 1
where அகல் is the word i gave in text field


Does the text after like start with two single quotes (')?  Then that is your problem.  Use one single quote to start and end the text.
 
surya preethaaa
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

output is    SELECT * FROM phpp WHERE value =You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
where it is wrong
 
Rancher
Posts: 4190
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If that's the error then it looks like $name is empty.
 
surya preethaaa
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i check like this

shows "name is set"..
don't know where is the error...
 
Dave Tolls
Rancher
Posts: 4190
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather than printing whether it is set, print its value.

Edit: both before and after doing the escaping.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!