General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 21st, 2004, 08:37 PM
charlielha charlielha is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 10 charlielha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Simple Insert

Can someone tell me what is wrong with this script?

<?php require_once('Connections/inquiries.php'); ?>
<?PHP
$myId = $HTTP_GET_VARS['USER_ID'];
$myInq = $HTTP_GET_VARS['INQUIRY_ID'];
$myComp = $HTTP_GET_VARS['COMP_ID'];
mysql_query ();
mysql_query("INSERT INTO supplier ('USER_ID', 'INQUIRY_ID', 'COMP_ID') VALUES('".$myId . "', '" .$myInq."', '".myComp."')";
?>

I get a blank page and the records are not inserted.

Thanks for any help

Reply With Quote
  #2  
Old January 21st, 2004, 10:48 PM
Mike_r Mike_r is offline
ExoCrew
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 68 Mike_r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
PHP Code:
<?php

     
require_once('Connections/inquiries.php'); ?>
     $myId = $HTTP_GET_VARS['USER_ID'];
     $myInq = $HTTP_GET_VARS['INQUIRY_ID'];
     $myComp = $HTTP_GET_VARS['COMP_ID'];
     mysql_query("INSERT INTO supplier (USER_ID, INQUIRY_ID, COMP_ID) VALUES("'".$myId . "', '" .$myInq."', '".myComp."')");

?>


Its all top of my head, I guess it should work .. Pick errors if any guys ...

By the way are you using the GET method for your form ?
__________________
ExoHelpDesk
ExoCrew Free Services

Reply With Quote
  #3  
Old January 21st, 2004, 11:47 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
mike_r has a ?> in a strange place =)

try this (corrected mike_r code):
PHP Code:
<?php 

     
require_once('Connections/inquiries.php');
     
$myId $HTTP_GET_VARS['USER_ID']; 
     
$myInq $HTTP_GET_VARS['INQUIRY_ID']; 
     
$myComp $HTTP_GET_VARS['COMP_ID']; 
     
mysql_query("INSERT INTO supplier (USER_ID, INQUIRY_ID, COMP_ID) VALUES("'".$myId . "''" .$myInq."''".myComp."')"); 

?>

Reply With Quote
  #4  
Old January 22nd, 2004, 09:27 PM
Mike_r Mike_r is offline
ExoCrew
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 68 Mike_r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Both codes should work, Just a little bit difference.

Reply With Quote
  #5  
Old January 22nd, 2004, 10:48 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
Bit of a difference?
My code works and yours doesn't... =P
Just kidding!

I copied yours directly, making one simply correction and tried to pass it as my own...
Let truth be known, I give full credit to Mike_r... ;-)

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Simple Insert


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 4 hosted by Hostway
Stay green...Green IT