Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old February 10th, 2003, 05:02 PM
ahprophet ahprophet is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 12 ahprophet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to ahprophet Send a message via Yahoo to ahprophet
Help with a query

I am entering data into a table via an html form. I distinguish the information by name but the problem is that names that include "&" don't seem to be working right.

example:
$result = mysql_query("SELECT * FROM event WHERE cname='$cname'");

however if $cname="blah & blah" for instance.. it doesnt work.

i want to be able to pull the info without assigning ID numbers. any suggestions? thanks!

Reply With Quote
  #2  
Old February 10th, 2003, 05:34 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Help with a query

Is it possible that the & is being turned into & before going into the database? Use a tool such as phpmyadmin to see what is actually in the database....

Reply With Quote
  #3  
Old February 10th, 2003, 06:00 PM
ahprophet ahprophet is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 12 ahprophet User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to ahprophet Send a message via Yahoo to ahprophet
RE: Help with a query

ok thanks for such a quick response! i checked out the database and what was being entered was accurate. i did find the problem though.

i am sending the name "blah & blah" through the url but what is actually being sent is "cname=blah%20&%20blah".

when i echoed $cname all i got was "blah" so my query statement would be messed up if i used $cname.

so... is there any way to send an ampersand through the URL and preserve the original syntax so my query will work??

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Help with a query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway