Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 05-20-2009, 06:47 AM PHP help Newbi
millwalll's Avatar
Webmaster Talker

Posts: 674
Name: James
Location: KENT
Trades: 3
Hi all,

Need some help trying to insert data into a database but its not working and not sure why.

Code:
<?php
$db = mysql_connect("server","username","password");
$result = mysql_select_db("m08jpr23", $db);
$Price = $_REQUEST['Price'];
$Description = $_REQUEST['Description'];
$query1 = "INSERT INTO price (Price,Description) VALUES ('$Price','$Description')";
mysql_close($db);
?>
and the table i and using

Code:
create table price (
price_code int not null auto_increment,
Price varchar(10) not null,
Description varchar(200) not null,
primary key (price_code)
)
engine = innodb;

all i get is blank page when i see if the data is in the table its not their..
__________________

Please login or register to view this content. Registration is FREE

Last edited by millwalll; 05-20-2009 at 06:54 AM..
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
 
Register now for full access!
Old 05-20-2009, 09:13 AM Re: PHP help Newbi
Super Talker

Posts: 134
Trades: 0
the mysql_query statement is missing

mysql_query ($query1);

(before the mysql_close statement)
__________________

Please login or register to view this content. Registration is FREE

Check out the Facebook Clone build with Jcow SNS at
Please login or register to view this content. Registration is FREE
, it is free and it always will be
Falcone is offline
Reply With Quote
View Public Profile
 
Old 05-20-2009, 10:22 AM Re: PHP help Newbi
millwalll's Avatar
Webmaster Talker

Posts: 674
Name: James
Location: KENT
Trades: 3
oh my god how did i miss that thanks
__________________

Please login or register to view this content. Registration is FREE
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
Reply     « Reply to PHP help Newbi
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29447 seconds with 12 queries