You are here: MySQL Syntax errors « PHP SQL « IT news, forums, messages
MySQL Syntax errors

Posted by John Hopper on 03/09/06 00:11

Hi all

I am currently trying to construct a database-driven membership site. I'm
using Dreamweaver MX 2004, php & MySQL.

All works well, but what I want the member homepage to do is to say 'Hello,
User1' or something along those lines - and I can get it to do this. The
trouble is, when User2, User3 etc log in, they all still see 'Hello, User1'.

I'm almost certain its to do with my SQL syntax. I can get the page to
display info from the database, but only if it's in the first row of the
database. How do I get the page to display info just for the user who is
actually logging in?

Ok, basics first:

The information is stored in a table called 'core'
The field names I want to display dynamically are called 'username' 'fname'
& 'lname'
Primary id key is called 'id' and is auto increment.

My attempt to get the database to show the information relating only to the
logged in user is as follows:

*********************
SELECT username, fname, lname
FROM core
WHERE core.id = id
*********************

The above is definately not working, plus seems too simple to be right!

Any assistance greatly appreciated. The answer is probably staring me right
in the face but as yet I just cannot see it!

TIA
John H

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация