Shopping Cart Forum

Go Back   eShop Forums - eCommerce Help Forum for Shopping Cart Owners. > Tech Corner > PHP/MySQL ASP.net and other server side technologies
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
PHP/MySQL ASP.net and other server side technologies Everything to do with the programming of websites. Discuss what goes on under the bonnet of your ecart or just chat about programming in general.

Pen n Paper, click here
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-07-2008, 09:02 PM
celticshaman's Avatar
celticshaman celticshaman is offline
Member
 
Join Date: May 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax error php form Help!!

I'm having a problem with a form to upload product details and images to a database. The form is displaying properly. When I try to submit information I get the following warning.

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\folder\admin\add_penda nt.php on line 124

When I put the query on line 124 into phpmyadmin I had a message saying syntax error. I thought maybe I should have put a semicolon after ($dbc, $query)) but that resulted in a blank page instead of the form.

I have spent all afternoon and evening on this problem, I hope somebody can help me.

This is the php code including the preceding and following lines

PHP Code:
if ($g && $sh && $s && $i && $d && $p && $ns && $wp && $pc) { // If everything's OK.
 
  // Add pendant to the database.
  
$query "INSERT INTO penants (pendant_id, gemstone, shape, size, image, description, price,
         no_in_stock, weight_of_pendant, postage_costs) VALUES ($a, '$g', $sh, '$s', '$i', '&d', '&p' '$ns', '$wp', '$pc')"
;
 
//Line 124 follows
 
  
if ($result mysql_query ($dbc$query)) { // Worked.
   
echo '<p>The pendant has been added.</p>';
  } else { 
// If the query did not run OK.
   
echo '<p><font color="red">Your submission could not be processed due to a system error.</font></p>'
  }
 
 } else { 
// Failed a test.
   
echo '<p><font color="red">Please click "back" and try again.</font></p>';
 } 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 17-07-2008, 09:58 PM
celticshaman's Avatar
celticshaman celticshaman is offline
Member
 
Join Date: May 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm still trying to get this sorted. If anyone has any suggestions please please let me know before my laptop goes out the window.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 18-07-2008, 05:43 PM
celticshaman's Avatar
celticshaman celticshaman is offline
Member
 
Join Date: May 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've resolved some of the problems, but there's still something wrong. I've had a successful file upload message but the database table is empty. I have no idea what's going on. I don't even know where to start or which questions I need to ask for help. I would be grateful for any imput.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 22-07-2008, 05:02 PM
Lawrence Lawrence is offline
Forum Admin
 
Join Date: Aug 2007
Location: Kenley, Surrey, UK
Posts: 1,130
Thanks: 0
Thanked 65 Times in 65 Posts
Default

Hi celticshaman.

The problem seems to be with $dbc, it's content isn't being recognised as a valid resource. The source of the problem is probably the line that defines it, it will look something like this.

PHP Code:
$dbc mysql_connect('localhost''mysql_user''mysql_password'); 
Double check your MySQL details, you'll probably find one of them is wrong.
__________________
Lawrence
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 22-07-2008, 09:24 PM
celticshaman's Avatar
celticshaman celticshaman is offline
Member
 
Join Date: May 2008
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your input Lawrence. I seem to have the mysql_connect file right now. You have reminded me of one check I could do tomorrow, which is the database table fields. I think I have checked it once, but I will look again, you never know, I might find a problem there.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Order Error jtaylor Zen Cart 3 14-04-2008 05:29 PM
Help with an ERROR please? pupsandpets Zen Cart 6 26-03-2008 06:17 AM
Error Message: MOM.EXE -.NET Framework Initializing Error Octopia Computers & IT 30 19-11-2007 05:16 PM
SSL Error BillH Zen Cart 4 14-10-2007 08:23 PM

Google

Edible Graphics, Affordable E-Commerce, Web Shops & Custom Form Scripts
Click here for domain name registration and web hosting
tech news, product reviews, the latest home and business technology, the latest in digital imaging


Content Relevant URLs by vBSEO 3.0.0