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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 06-14-2005, 12:06 AM   #1
wedouglas
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']
wedouglas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-14-2005, 12:07 AM   #2
Varius
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
Varius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-14-2005, 12:08 AM   #3
jwerd
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
jwerd is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-14-2005, 12:12 AM   #4
wedouglas
So Fucking Banned
 
Join Date: Aug 2004
Location: Dearborn, MI
Posts: 5,921
nope and nope....
wedouglas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-14-2005, 12:16 AM   #5
rickholio
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())");
__________________
~

Last edited by rickholio; 06-14-2005 at 12:19 AM..
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-14-2005, 12:21 AM   #6
rickholio
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.
__________________
~
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-14-2005, 12:22 AM   #7
Meorazhar
Confirmed User
 
Meorazhar's Avatar
 
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'].'),
Meorazhar is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-14-2005, 12:26 AM   #8
Meorazhar
Confirmed User
 
Meorazhar's Avatar
 
Industry Role:
Join Date: May 2005
Location: ICQ: 5262689
Posts: 672
And, like it was stated, you will need an extra closing )
Meorazhar is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-14-2005, 12:27 AM   #9
wedouglas
So Fucking Banned
 
Join Date: Aug 2004
Location: Dearborn, MI
Posts: 5,921
Quote:
Originally Posted by rickholio
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.
Im just trying to create a fix for a problem im having. is there a quick way to copy data from one table to another?
wedouglas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-14-2005, 12:29 AM   #10
rickholio
Confirmed User
 
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
Quote:
Originally Posted by wedouglas
Im just trying to create a fix for a problem im having. is there a quick way to copy data from one table to another?
Code:
insert into TARGET_TABLE 
  select column1, column2, column3, etc from SOURCE_TABLE 
    where some_column=some_criteria;
__________________
~
rickholio is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-14-2005, 12:33 AM   #11
wedouglas
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
wedouglas is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.