OZONE Asylum
Forums
Server-Side Scripting - Oh my!
Problem checking for exsisting data
This page's ID:
29069
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
Following my lyrics database project, I'm taking user-input and checking if the artist already exsists within the database. If it does the data is appended to the artists record of songs and if not the Artist is added to the database in theroy. Unfortunatly, PHP is chucking all sorts of errors and killing the script, despite the lack of result being the desired effect.. It just isn't reacitng as I would of expected it too. My code [code] $query = "SELECT artist_name FROM artist WHERE artist_name = $artist"; $sql = mysql_query($query); $result = mysql_num_rows($sql); [/code] which out puts the following error [code] Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/official/public_html/lyrics/submitlyrics.php on line 20 Unknown column 'Eminem' in 'where clause' [/code] Now, I can't find the error after hours of looking and asking everyone I could think of. The sql seems fine as "Unkown column 'Eminem'" seems to outline. But, I can't check the number of rows? because its not a valid mysql result resource? Where does my problem lie? [small](Edited by [url=http://www.ozoneasylum.com/user/2151]Trigger[/url] on 03-25-2007 21:57)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »
Maximum Security
OZONE
DHTML/Javascript
Server-Side Scripting - Oh my!
CSS - DOM - XHTML - XML - XSL - XSLT
Stupid Basic HTML
Visual Therapy
Photoshop
Photoshop Pong, Anyone?
***WARNING*** BIG SIG APPROACHING
Photography
3D Modelling & Rendering
Multimedia/Animation
Print Graphics
Holding Pens
Philosophy and other Silliness
Outpatient Counseling
Site reviews!
Mad Scientists' Laboratory
Getting to know the Grail