Topic: "PHP Weirdness" (page 2 of 4)

< 1 2 3 4 >
Author Post
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
Yes there is a $_COOKIE['PHPSESSID'] that is set.
private message Website
aceldama
groupmastergroupmastergroupmastergroupmaster
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.
private message
aceldama
groupmastergroupmastergroupmastergroupmaster
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.
private message
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
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

:S
Edited by sniperkid on 02.07.2012 09:23:17
private message Website
aceldama
groupmastergroupmastergroupmastergroupmaster
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
private message
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
nothing outputs (the $username in the query messes it up - if i replace with * it outputs everything).
private message Website
aceldama
groupmastergroupmastergroupmastergroupmaster
QuoteQuote 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
private message
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
nothing returned.
private message Website
aceldama
groupmastergroupmastergroupmastergroupmaster
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
private message
sniperkid
groupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmastergroupmaster
[0] => 1
[ID] => 1
[1] => sniperkid
[Username] => sniperkid
[2] => [pwd]
[Password] => [pwd]
[3] => email
email => email
[4] =>
[LastLogin] =>
[5] => 1
[AccessLevel] => 1
Edited by sniperkid on 02.07.2012 10:14:18
private message Website

Topic: "PHP Weirdness" (page 2 of 4)

< 1 2 3 4 >