Jump to content


Photo

insert into $site_prefix . '_users' (?)


  • Please log in to reply
3 replies to this topic

#1 StirCrazy

StirCrazy
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 22 July 2006 - 02:01 AM

I'm trying to sort out a multisite (passport' ish!) registration system for couple of sites i have planned.

I'm trying to add the data into prefixed tables ~ what's wrong with the bit in bold below?
At the moment it's just not writing anything to the database at all.

global $site_prefix;

my_query("insert into $site_prefix . '_users' (id,username,email,password.....


Many Thanks,

S.C>

#2 Joe Haley

Joe Haley
  • Members
  • PipPipPip
  • Advanced Member
  • 103 posts
  • LocationCanada, eh?

Posted 22 July 2006 - 02:04 AM

"insert into $site_prefix . '_users'  (id,username,em
" = variables are parsed to their values

"insert into $site_prefix . '_users'  (id,username,em
Wrong. Why the .? you never break out of quotes.

Try:

"insert into {$site_prefix}_users  (id,username,em...

or

'insert into ' . $site_prefix . '_users  (id,username,em...
Give a man a fish; you have fed him for today.  Teach a man to fish; and you have fed him for a lifetime
Don't teach men to program. Teach them to fish.

Please, try the RTFM solution before asking for help:
http://php.net/manual/en/index.php

#3 StirCrazy

StirCrazy
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 22 July 2006 - 02:19 AM

Luvly job Joe  ;D

{$site_prefix}_users sorted it out.

Thanks for the explaination.

S.C>

#4 localhost

localhost
  • Members
  • PipPipPip
  • Advanced Member
  • 152 posts

Posted 22 July 2006 - 07:07 AM

that helps me out as well, I was about to implement that into my software!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users