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.

The Database Forum


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



Reply
Doesn't input any data
Old 07-20-2007, 11:01 PM Doesn't input any data
Skilled Talker

Posts: 99
Trades: 0
Can someone tell me why the query is not successful!!!

PHP Code:
<?php
$username 
$_POST["username"];
$password $_POST["password"];

$con mysql_connect("localhost","root","blah");
if (!
$con)
    {
    die(
'Could not connect: ' mysql_error());
    }

mysql_select_db("test"$con);

$sql "INSERT INTO names (username, password)
VALUES ("
$username","$password")";

if (!
mysql_query($sql,$con))
    {
    die(
'Error: ' mysql_error());
    }
echo 
"1 record added";

mysql_close($con)
?>

Last edited by Arez20469; 07-20-2007 at 11:03 PM..
Arez20469 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-20-2007, 11:44 PM Re: Doesn't input any data
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
What's the error message you're getting?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 08-07-2007, 04:06 PM Re: Doesn't input any data
Super Talker

Posts: 134
Trades: 0
$sql = "INSERT INTO names (username, password)
VALUES ("
$username","$password")";

change " by ' and try again ==>
VALUES ('$username','$password')
Falcone is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Doesn't input any data
 

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.11233 seconds with 12 queries