Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

prepared query join problems.

$
0
0

Good evening,

 

I am trying to create a user profile system on my website. I have the ability to register and login fine. I've hard coded a dummy profile into the profiles table.

 

The way in which I am going to retrieve the profile data is by matching the users username in both tables.

 

At the moment my query is returning all of the members in the user table and all of the profile information in the other table - profiles.

 

This is my query:

 
$stmt = $conn->prepare("SELECT * FROM users LEFT JOIN profiles ON users.? = profiles.username") or die("Error: ".mysqli_error($conn));
 

Not sure if the way I am going about it is the correct way either so any advice and guidance is greatly received.

 

Kind regards,

 

L2c.


Viewing all articles
Browse latest Browse all 13200

Trending Articles