September 07, 2008, 19:41:51
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Check your Page Rank, Backlinks, or Link Popularity in our tools section.
Home
Forum
Help
Search
Directory
Calendar
Login
Register
News
Check your Page Rank, Backlinks, or Link Popularity in our tools section.
IT Resources
Recover Deleted Files
Php Hosting
Hot Wallpapers
Free Articles
Mousepad
Cheap Hosting
PDF to Doc Converter
Internet Eraser
Linux web hosting
DoFollow Sites
Movie Reviews
Webmaster's Talks !
>
Forum
>
Programming
>
Databases
>
What's wrong with this script ?
Pages: [
1
]
« previous
next »
Print
Author
Topic:
What's wrong with this script ?
(Read 1461 times)
0 Members and 1 Guest are viewing this topic.
sintex
Jr. Member
Points: 7
Offline
Posts: 96
What's wrong with this script ?
«
on:
June 09, 2006, 20:23:16 »
What's wrong with this code ?
Code:
$query= 'INSERT INTO `plb_ids` (`id`, `user`, `password`, `email`, date) VALUES (NULL, $username, $pass, $email, now());';
mysql_query($query);
The code is "working" but is inserting in my database $username and $password not the variables.
Any help is appreciated. Thanks
Logged
TheGodFather
Administrator
Hero Member
Points: 202
Offline
Posts: 2570
Re: What's wrong with this script ?
«
Reply #1 on:
June 09, 2006, 21:55:27 »
Try to use double quote " not just ' and change ` wuth '
Regards
Logged
█
Deleted Domains
█
Hostmaster Web Tools
█
Webmaster Web Tools
chris3471
Full Member
Points: 3
Offline
Posts: 187
Re: What's wrong with this script ?
«
Reply #2 on:
June 09, 2006, 23:18:17 »
Quote from: sintex on June 09, 2006, 20:23:16
What's wrong with this code ?
Code:
$query= 'INSERT INTO `plb_ids` (`id`, `user`, `password`, `email`, date) VALUES (NULL, $username, $pass, $email, now());';
mysql_query($query);
The code is "working" but is inserting in my database $username and $password not the variables.
Any help is appreciated. Thanks
This should work, you shouldn't need the back quotes either.
Code:
$query= "INSERT INTO plb_ids (id, user, password, email, date)
VALUES ('NULL', '$username', '$pass', '$email', 'now();')";
mysql_query($query);
Logged
SMB Webmaster Forums
Harro
Full Member
Points: 2
Offline
Posts: 184
Re: What's wrong with this script ?
«
Reply #3 on:
June 11, 2006, 03:39:10 »
Not realy familiar with sql and php. But shouldn't it be this:
Code:
$query= "INSERT INTO plb_ids (id, user, password, email, date)
VALUES ('NULL', '" . $username . "', '" . $pass . "', '". $email . "', '". now() . ";')";
mysql_query($query);
Logged
Cookiemonster's Kitchen
Forum Affiliates Network - More than exchanging
chris3471
Full Member
Points: 3
Offline
Posts: 187
Re: What's wrong with this script ?
«
Reply #4 on:
June 12, 2006, 04:08:46 »
No, what I posted above is correct.
Logged
SMB Webmaster Forums
bernkly
Jr. Member
Points: 0
Offline
Posts: 6
Re: What's wrong with this script ?
«
Reply #5 on:
June 17, 2006, 17:33:44 »
I think both chris3471 and Harro style are correct.
I'm usually using the same style as chris3471. Although it was in quote '$username', the php would recognise $ as a variable and get the value from it.
Logged
Send
self destruct message
sintex
Jr. Member
Points: 7
Offline
Posts: 96
Re: What's wrong with this script ?
«
Reply #6 on:
August 18, 2006, 00:10:04 »
Thanks for help.
Logged
scolls
Jr. Member
Points: 0
Offline
Posts: 19
Re: What's wrong with this script ?
«
Reply #7 on:
November 11, 2006, 00:28:49 »
Quote from: Harro on June 11, 2006, 03:39:10
Not realy familiar with sql and php. But shouldn't it be this:
Code:
$query= "INSERT INTO plb_ids (id, user, password, email, date)
VALUES ('NULL', '" . $username . "', '" . $pass . "', '". $email . "', '". now() . ";')";
mysql_query($query);
This will certainly ensure that the values of the variables are insterted.
Also, since your id field is an auto-increment field, it's unnecesary to insert anything there, eg you can leave out the "id" and "NULL" in your query - the id will still auto-increment.
Logged
WebWobot Search Engine
|
Search Engine Forums
|
le-Magasin.ch ~ Annuaire d'e-Commerce
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Web Design and Graphics
-----------------------------
=> General
=> Web Design Discussion
===> Adobe Photoshop, Corel PhotoPaint or other Image editing software
===> Dreamweaver, FrontPage or other WYSIWYG software
=> Web Design Reviews
=> Design Contest
-----------------------------
Programming
-----------------------------
=> Databases
=> PHP
=> ASP
=> Javascript
=> Java
=> General Coding
===> Perl
===> .NET
-----------------------------
Search Engine
-----------------------------
=> Google
=> Yahoo
=> MSN
=> Other Search Engines
=> Web Directories
===> SMF Directory
-----------------------------
Domain Names
-----------------------------
=> Domain Name Discussion
=> Domain Appraisals
=> Expired Domains
-----------------------------
Server Related
-----------------------------
=> Forum/CMS Related
=> Apache/IIS
=> Security
=> Linux
===> General Questions
===> Installations
===> Desktop & Multimedia
===> System configurations problems
===> Kernel things
-----------------------------
The Webmasters Talks !
-----------------------------
=> General Discussion
===> Fun
=> Tools
===> Link Popularity
===> Google Datacenter Query
===> Google Backlinks Checker
===> Google Page Rank Checker
===> Html Validation
===> Alexa Rank Checker
===> SEO 4 SMF
=====> Showcase
=====> Joomla
=====> Bugs
=====> Features
=> New Member Introductions
=> Suggestions & Feedback
=> News and Announcements
Loading...