Author | Post | ||
sniperkid |
Yes there is a $_COOKIE['PHPSESSID'] that is set. |
||
02.07.2012 08:55:03 |
|
||
aceldama |
then i guess i am not of much use to you. i'd start by looking at the mysql logs, and apache logs. also check whether the apache server is running under a less priviledged permission than the mysql server (not that it's likely but that might explain the lack of communication). but the browser localhost cookie issue is something i had a problem with a while back and that was my best guess. |
||
02.07.2012 09:00:37 |
|
||
aceldama |
i'd also consider double checking to see that both apache and mysql have read, write and execute permissions to their directories. if this doesn't solve the problem you can always set it back. |
||
02.07.2012 09:10:14 |
|
||
sniperkid |
Thanks for trying I also tried the following: $username = $_SESSION['username']; echo "User: ".$username."<br />"; $sQuery = mysql_query("SELECT * FROM tblUsers"); while($oUser=mysql_fetch_object($sQuery)){ echo "\"".$oUser->Username."\":\"$username\" "; if ($oUser->Username == $username){ echo "match"; }else{ echo "no match"; } and it shows: User: sniperkid "sniperkid":"sniperkid" no match |
||
Edited by sniperkid on 02.07.2012 09:23:17 | |||
02.07.2012 09:22:28 |
|
||
aceldama |
ok, one last attempt before i hit the sack - try the following code and tell me what it says: $username = $_SESSION['username']; echo "User: ".$username."<br />"; $sQuery = mysql_query("SELECT $username FROM tblUsers"); $result = mysql_fetch_array( $sQuery ); print_r($result); also i assume from the first post that you made the db connection, right? mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("tblUsers") or die(mysql_error()); so effectively the code looks like this: mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("tblUsers") or die(mysql_error()); $username = $_SESSION['username']; echo "User: ".$username."<br />"; $sQuery = mysql_query("SELECT $username FROM tblUsers"); $result = mysql_fetch_array( $sQuery ); print_r($result); |
||
Edited by aceldama on 02.07.2012 09:41:11 | |||
02.07.2012 09:30:21 |
|
||
sniperkid |
nothing outputs (the $username in the query messes it up - if i replace with * it outputs everything). |
||
02.07.2012 09:46:26 |
|
||
aceldama |
Quote from sniperkid: nothing outputs (the $username in the query messes it up - if i replace with * it outputs everything). ok then do the same but for the query use select * from tblUsers where username = $username |
||
02.07.2012 10:03:55 |
|
||
sniperkid |
nothing returned. |
||
02.07.2012 10:08:23 |
|
||
aceldama |
you're making this exceedingly difficult by being too cryptic. you're effectively asking how long is a piece of string. in order for me to understand your table, give me the output of select * from tblusers as a print_r but just remove passwords etc. of things you don't want. i need the exact column names, and how many columns there are. |
||
Edited by aceldama on 02.07.2012 10:11:02 | |||
02.07.2012 10:09:54 |
|
||
sniperkid |
[0] => 1 [ID] => 1 [1] => sniperkid [Username] => sniperkid [2] => [pwd] [Password] => [pwd] [3] => => [4] => [LastLogin] => [5] => 1 [AccessLevel] => 1 |
||
Edited by sniperkid on 02.07.2012 10:14:18 | |||
02.07.2012 10:13:29 |
|