Help with query

Started by sledge4, November 20, 2008, 02:54:21 PM

Previous topic - Next topic

sledge4

I'm trying to pass $context['user']['name'] into sql query.

What i'm trying to do is...based on who is logged in, pull data related to that person onto a webpage.

Can anyone provide assistance?

Here is my current query:

$result = mysql_query("SELECT * FROM a_site_user WHERE forumName = '')

forumName is where i'm trying to match the user logging in to the data i'm trying to pull.

Thanks much,
Will

ninedoors

Are you using SSI.php?

It would be a lot easier if you used the user id instead of name.  $context['user']['id] and have a forumID that is linked to the forumName.  Just a thought.

Nick
A government big enough to give you everything you want is big enough to take everything you have!

SMF 2.0
BMHL custom theme

SMF community is a great bunch of people!

[SiNaN]

Use it like this: $context[user][name] (without the single quotes)
Former SMF Core Developer | My Mods | SimplePortal

Advertisement: