![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
So Fucking Banned
Join Date: Aug 2004
Location: Dearborn, MI
Posts: 5,921
|
need MYSQL help here
whats wrong with this command?
Insert into bBadult_config (id, name, value) VALUES ( ('1', 'EMAIL', 'change@me'), ('2', 'BLOGNAME', '.$config['blogname'].'), ('3', 'TEMPLATE', 'default'), ('4', 'DB_TEMPLATES', 'false'), ('5', 'DEFAULT_MODIFIER', 'simple'), ('6', 'DEFAULT_STATUS', 'live'), ('7', 'PING','false'), ('8', 'COMMENT_MODERATION','none'), ('9', 'NOTIFY','false'), ('12', 'META_DESCRIPTION', 'Some words about this blog'), ('13', 'META_KEYWORDS','work,life,play,web design'), ('15', 'EMAIL','[email protected]'), ('10', 'BLOG_DESCRIPTION', '.$config['blogdescription'].'), ('14', 'LAST_MODIFIED', UNIX_TIMESTAMP()); Its telling me: ERROR 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' 'EMAIL', 'change@me'), ('2', 'BLOGNAME', '.$config['blogname'] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
|
I believe you are missing a closing ) at the end.
__________________
Skype variuscr - Email varius AT gmail |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Jun 2003
Location: Costa Rica
Posts: 1,953
|
Instead of:
('2', 'BLOGNAME', '.$config['blogname'].'), Try: ('2', 'BLOGNAME', '".$config['blogname']."'),
__________________
Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
So Fucking Banned
Join Date: Aug 2004
Location: Dearborn, MI
Posts: 5,921
|
nope and nope....
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
You have an extra ( after values. Multi row inserts have brackets around each row, not around all rows.
Also, every one of those $config[blogname]'s need to be encapsulated in additional quotes unless $config[blogname] is guaranteed to be a number of some variety. HTH. HAND. ![]() BTW - you *can* use subscripted arrays within quotes in PHP, thusly: $result = mysql_query("Insert into bBadult_config (id, name, value) VALUES (1, 'EMAIL', 'change@me'), (2, 'BLOGNAME', '$config[blogname]'), (3, 'TEMPLATE', 'default'), (4, 'DB_TEMPLATES', 'false'), (5, 'DEFAULT_MODIFIER', 'simple'), (6, 'DEFAULT_STATUS', 'live'), (7, 'PING','false'), (8, 'COMMENT_MODERATION','none'), (9, 'NOTIFY','false'), (12, 'META_DESCRIPTION', 'Some words about this blog'), (13, 'META_KEYWORDS','work,life,play,web design'), (15, 'EMAIL','[email protected]'), (10, 'BLOG_DESCRIPTION', '$config[blogdescription]'), (14, 'LAST_MODIFIED', UNIX_TIMESTAMP())");
__________________
~ ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
I also hope that you're filtering and mysql_real_escape_string()ing any data that might be user-input, so's to take care of storing data with quotes and stripping out possible exploit code.
![]()
__________________
~ ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: May 2005
Location: ICQ: 5262689
Posts: 672
|
Hello,
use ('2', 'BLOGNAME', $config['blogname']), instead of ('2', 'BLOGNAME', '.$config['blogname'].'), Same applies to this: ('10', 'BLOG_DESCRIPTION', '.$config['blogdescription'].'), |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Industry Role:
Join Date: May 2005
Location: ICQ: 5262689
Posts: 672
|
And, like it was stated, you will need an extra closing )
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
So Fucking Banned
Join Date: Aug 2004
Location: Dearborn, MI
Posts: 5,921
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
Quote:
Code:
insert into TARGET_TABLE select column1, column2, column3, etc from SOURCE_TABLE where some_column=some_criteria;
__________________
~ ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
So Fucking Banned
Join Date: Aug 2004
Location: Dearborn, MI
Posts: 5,921
|
thanks. I just cant seem to figure out this issue. I have a blog installed on my main domain http://www.digitalconfessional.net
but when i try to install another one on the subdomain http://adult.digitalconfessional.net it wont work. Even if i tell it to use the same database and table prefix. makes no sense |
![]() |
![]() ![]() ![]() ![]() ![]() |