The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
calling all php and mysql guru's
Ive been searching for a day now and im going to cry soon.
I am to make a project a dummy website e-commerce website. So security and all the other things are not so important, just need things to be bland and plain but most importantly to work! Ive got a mysql db set up, and my users can log in and log out thats working. Now here is the problem. Once that particular user logs in i want him/her to be able to view the details stored on the db about them, i.e. their firstname, surname, email etc Ive been trying so many methods but none seem to work or some are giving me blank results. If somebody can help me with this, it would be much appreciated. |
#2
|
||||
|
||||
Is this using your own backend or vBulletin's? (I'm guessing your own) You will need to query the database for the user's row and output the information.
PHP Code:
|
#3
|
|||
|
|||
This is the test data in my contacts table as you can see: http://www.photo-host.org/img/958319table.jpg
ive inserted this, is this correct?: Code:
$result = mysql_query("SELECT * FROM 'contacts' WHERE 'member_id' = " . $member_id . " LIMIT 1"); $row = mysql_fetch_assoc($result); I can login in fine with this error on top: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in e:\webareas\am663\carttest\login.php on line 8 EDIT: I added the "@" in front of mysql_fetch_assoc($result); which seemed to have removed the error message but when i call the data from the db e.g. echo $row['$member_id']; echo $row['$username']; nothing shows up on my members page? |
#4
|
||||
|
||||
PHP Code:
|
#5
|
|||
|
|||
Quote:
"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 '' at line 3" ?? Im on my university server, do i upload a phpinfo file to find out? |
#6
|
||||
|
||||
What is the $member_id value set to? I'm assuming it's an integer... right?
|
#7
|
|||
|
|||
Quote:
Code:
CREATE TABLE contacts ( member_id int(30) NOT NULL auto_increment, firstname varchar(30) NOT NULL default '', surname VARCHAR(30) NOT NULL default '', contact_no INT(11), housename_no VARCHAR(20), address_line1 VARCHAR(20), address_line2 VARCHAR(20), address_line3 VARCHAR(20), city_county VARCHAR(15), postcode VARCHAR(8), email varchar(30) NOT NULL default '', username varchar(25) NOT NULL default '', password varchar(255) NOT NULL default '', PRIMARY KEY (member_id), UNIQUE KEY username (username) ) TYPE=MyISAM COMMENT='Members'; |
#8
|
||||
|
||||
In your query you use $member_id ... what is the value of that?
|
#9
|
|||
|
|||
What do you mean? the value in the sql table or in the php code?
|
#10
|
||||
|
||||
The PHP variable... if its empty (and I'm pretty sure it is) the query will die because:
SELECT * FROM TABLE WHERE id = ; Is not valid. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|