Forum Moderators: coopster
Essentially I'm trying to use the session information to single out a row on a table and display it.
Does this make sense at all? Or is there an easier way to do this?
Thanks
Jon
Here is the code I've been trying to deal with...Clearly its wrong :)
$sql = 'SELECT id, name, username, email FROM clients WHERE username = "<?php . get_username ( $_SESSION['user_id'] ); ?>" ';
$sql = 'SELECT id, name, username, email FROM clients WHERE username = "<?php . get_username ( $_SESSION['user_id'] ); ?>" ';
Presumably this is already in a <?php...?> section, so you don't need to (and shouldn't) escape your PHP again...
<?php
// PHP code....
$sql = 'SELECT id, name, username, email FROM clients WHERE username = "' . get_username($_SESSION['user_id']) . '"';
// More PHP code to execute your query....
?>