-
Posts
1,686 -
Joined
-
Last visited
Never
Everything posted by Lamez
-
hey guys have a look at my website: http://www.lamezz.com tell me, is the background to much?
-
awesome thank you!
-
is it possible to get a image at the bottom of a div? for example: www.lamezz.com I want the image above the footer, but below all the content, is this possible. also is the background too much?
-
right, but when I do that anything in between the {} are hidden here is what I have so I can get some sort of output if (mysql_num_rows ($email) > 0) //see if something was found while ($row2 = mysql_fetch_object ($email)) { }//get the info from that result using a mysql_fetch statement but then I still get a Resource id #20
-
ok now I get another error about I have a unexpected } on like 166 /*Sorts by Online*/ function displayOnline(){ global $database; $q = "SELECT username,timestamp " ."FROM ".TBL_ACTIVE_USERS." ORDER BY timestamp DESC,username"; $result = $database->query($q); /* Error occurred, return given name by default */ $num_rows = mysql_num_rows($result); if(!$result || ($num_rows < 0)){ echo "Error displaying info"; return; } if($num_rows == 0){ echo "Database table empty"; return; } /* Display table contents */ echo "<table width=\"550\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n"; //Table's Specs echo "<tr>\n"; echo "<td valign=\"bottom\"><strong>Username</strong></td>\n"; //Username Column echo "<td width=\"80\" valign=\"bottom\"> </td>\n"; //Table Spacer echo "<td valign=\"bottom\"><strong>Email</strong></td>\n"; //Email Column echo "<td valign=\"bottom\"> </td>\n"; //Table Spacer echo "<td valign=\"bottom\"><strong>Status</strong></td>\n"; //Status Column echo "</tr>\n"; echo "<tr>\n"; echo "<td height=\"1\" colspan=\"5\" align=\"center\" valign=\"top\"><div class=\"dot\"></div></td>\n"; //Dotted Line echo "</tr>\n"; for($i=0; $i<$num_rows; $i++){ $uname = mysql_result($result,$i,"username"); $eq = "SELECT email FROM ".TBL_USERS." WHERE email = '$uname'"; //build the query $email = mysql_query ($eq) or die ("Error in query: $eq. " . mysql_error()); //execute the query, get the Resource number in $result2 variable $time = mysql_result($result,$i,"timestamp"); if (mysql_num_rows ($email) > 0) { //see if something was found while ($row2 = mysql_fetch_object ($email)) //get the info from that result using a mysql_fetch statement } echo "<tr>\n"; echo "<td><a href=\"userinfo.php?user=$uname\">$uname</a><br></td>\n"; echo "<td> </td>\n"; echo "<td>$email</td>\n"; echo "<td> </td>\n"; echo "<td align=\"left\">\n"; /* Tells the if they are online or offline */ $query = mysql_query("SELECT u.username FROM users u INNER JOIN active_users a ON a.username=u.username WHERE a.timestamp < (NOW() - INTERVAL 5 MINUTE) AND u.username='$uname'")or die(mysql_error()); if (mysql_num_rows($query) > 0){ echo "<font color=\"#04db04\">Online</font>"; } else { echo "<font color=\"#FF0000\">Offline</font>"; } } echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; } what is wrong..here is my whole code here is my query $eq = "SELECT email FROM ".TBL_USERS." WHERE email = '$uname'"; //build the query $email = mysql_query ($eq) or die ("Error in query: $eq. " . mysql_error()); //execute the query, get the Resource number in $result2 variable if (mysql_num_rows ($email) > 0) { //see if something was found while ($row2 = mysql_fetch_object ($email)) //get the info from that result using a mysql_fetch statement } //166
-
ok I am getting errors about my brackets, here is what I am using as my query and result $eq = "SELECT email FROM ".TBL_USERS." WHERE email = '$uname'"; //build the query $email = mysql_query ($eq) or die ("Error in query: $eq. " . mysql_error()); //execute the query, get the Resource number in $result2 variable if (mysql_num_rows ($email) > 0) { //see if something was found while ($row2 = mysql_fetch_object ($email) //get the info from that result using a mysql_fetch statement } am I doing it wrong, maybe If I explain better what I am trying to do: I am trying to pull the column email from the users table, and place it with the matching username in the active users table.
-
now there is no output at all. I am completly new to MySQL query, this was my first
-
oh ok, this is for a members list (if you would like to see it in action: http://www.lamezz.com/user/viewmembers.php?sort=online, user: test1 pass:test) anyways here is the whole function /*Sorts by Online*/ function displayOnline(){ global $database; $q = "SELECT username,timestamp " ."FROM ".TBL_ACTIVE_USERS." ORDER BY timestamp DESC,username"; /*$q = "SELECT username, timestamp " ."FROM".TBL_ACTIVE_USERS. "INNER JOIN".TBL_USERS."ON".TBL_ACTIVE_USERS.username "=" .TBL_USERS.email */ $result = $database->query($q); /* Error occurred, return given name by default */ $num_rows = mysql_num_rows($result); if(!$result || ($num_rows < 0)){ echo "Error displaying info"; return; } if($num_rows == 0){ echo "Database table empty"; return; } /* Display table contents */ echo "<table width=\"550\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n"; //Table's Specs echo "<tr>\n"; echo "<td valign=\"bottom\"><strong>Username</strong></td>\n"; //Username Column echo "<td width=\"80\" valign=\"bottom\"> </td>\n"; //Table Spacer echo "<td valign=\"bottom\"><strong>Email</strong></td>\n"; //Email Column echo "<td valign=\"bottom\"> </td>\n"; //Table Spacer echo "<td valign=\"bottom\"><strong>Status</strong></td>\n"; //Status Column echo "</tr>\n"; echo "<tr>\n"; echo "<td height=\"1\" colspan=\"5\" align=\"center\" valign=\"top\"><div class=\"dot\"></div></td>\n"; //Dotted Line echo "</tr>\n"; for($i=0; $i<$num_rows; $i++){ $uname = mysql_result($result,$i,"username"); $email = mysql_query("SELECT email FROM ".TBL_USERS." WHERE username = 'email'"); $time = mysql_result($result,$i,"timestamp"); echo "<tr>\n"; echo "<td><a href=\"userinfo.php?user=$uname\">$uname</a><br></td>\n"; echo "<td> </td>\n"; echo "<td>$email</td>\n"; echo "<td> </td>\n"; echo "<td align=\"left\">\n"; /* Tells the if they are online or offline */ $query = mysql_query("SELECT u.username FROM users u INNER JOIN active_users a ON a.username=u.username WHERE a.timestamp < (NOW() - INTERVAL 5 MINUTE) AND u.username='$uname'")or die(mysql_error()); if (mysql_num_rows($query) > 0){ echo "<font color=\"#04db04\">Online</font>"; } else { echo "<font color=\"#FF0000\">Offline</font>"; } } echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; } hope that helps you to help me!
-
alright I have googled my problem in hope of looking for a solution, but I found nothing. I am trying to pull the email from the user table for the user. but I get this: Resource id #20 for the email output what does it mean? here is my query: $email = mysql_query("SELECT email FROM ".TBL_USERS." WHERE username = '$uname'"); am I doing somthing wrong?
-
sorry I am a noob, and I hate to indent when I am coding. I know I should.
-
thank you very much!! that did it!
-
I don't understand. here is my latest code /*Sorts by Offline*/ function displayOffline(){ global $database; $q = "SELECT username,email,timestamp " ."FROM ".TBL_USERS." ORDER BY timestamp DESC,username"; $result = $database->query($q); /*Error occurred, return given name by default */ $num_rows = mysql_numrows($result); if(!$result || ($num_rows < 0)){ echo "Error displaying info"; return; } if($num_rows == 0){ echo "Database table empty"; return; } /* Display table contents */ echo "<table width=\"550\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n"; //Table's Specs echo "<tr>\n"; echo "<td valign=\"bottom\"><strong>Username</strong></td>\n"; //Username Column echo "<td width=\"80\" valign=\"bottom\"> </td>\n"; //Table Spacer echo "<td valign=\"bottom\"><strong>Email</strong></td>\n"; //Email Column echo "<td valign=\"bottom\"> </td>\n"; //Table Spacer echo "<td valign=\"bottom\"><strong>Status</strong></td>\n"; //Status Column echo "</tr>\n"; echo "<tr>\n"; echo "<td height=\"1\" colspan=\"5\" align=\"center\" valign=\"top\"><div class=\"dot\"></div></td>\n"; //Dotted Line echo "</tr>\n"; for($i=0; $i<$num_rows; $i++){ $uname = mysql_result($result,$i,"username"); $email = mysql_result($result,$i,"email"); $time = mysql_result($result,$i,"timestamp"); $query = mysql_query("SELECT u.username FROM users u, active_users a WHERE a.timestamp < (NOW() - INTERVAL 5 MINUTE) AND a.username='$uname' AND u.username=a.username")or die(mysql_error()); if (mysql_num_rows($query) > 0){ //somthing to filter out online peeps } else { //show offline peeps and hide online echo "<tr>\n"; echo "<td><a href=\"userinfo.php?user=$uname\">$uname</a><br></td>\n"; echo "<td> </td>\n"; echo "<td>$email</td>\n"; echo "<td> </td>\n"; echo "<td align=\"left\">\n"; $online = mysql_query("SELECT u.username FROM users u INNER JOIN active_users a ON a.username=u.username WHERE a.timestamp < (NOW() - INTERVAL 5 MINUTE) AND u.username='$uname'")or die(mysql_error()); if (mysql_num_rows($online) > 0){ echo "<font color=\"#04db04\">Online</font>"; } else { echo "<font color=\"#FF0000\">Offline</font>"; } echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; } } } I have the ending table tags
-
oh sorry login with: user: test1 pass: test then have a look, it looks all messy
-
it worked, but now it is not showing my table, ever thing is smooshed together. http://www.lamezz.com/user/viewmembers.php?sort=offline did I put my query in the wrong spot? /*Sorts by Offline*/ function displayOffline(){ global $database; $q = "SELECT username,email,timestamp " ."FROM ".TBL_USERS." ORDER BY timestamp DESC,username"; $result = $database->query($q); /*Error occurred, return given name by default */ $num_rows = mysql_numrows($result); if(!$result || ($num_rows < 0)){ echo "Error displaying info"; return; } if($num_rows == 0){ echo "Database table empty"; return; } /* Display table contents */ echo "<table width=\"550\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n"; //Table's Specs echo "<tr>\n"; echo "<td valign=\"bottom\"><strong>Username</strong></td>\n"; //Username Column echo "<td width=\"80\" valign=\"bottom\"> </td>\n"; //Table Spacer echo "<td valign=\"bottom\"><strong>Email</strong></td>\n"; //Email Column echo "<td valign=\"bottom\"> </td>\n"; //Table Spacer echo "<td valign=\"bottom\"><strong>Status</strong></td>\n"; //Status Column echo "</tr>\n"; echo "<tr>\n"; echo "<td height=\"1\" colspan=\"5\" align=\"center\" valign=\"top\"><div class=\"dot\"></div></td>\n"; //Dotted Line echo "</tr>\n"; for($i=0; $i<$num_rows; $i++){ $uname = mysql_result($result,$i,"username"); $email = mysql_result($result,$i,"email"); $time = mysql_result($result,$i,"timestamp"); $query = mysql_query("SELECT u.username FROM users u, active_users a WHERE a.timestamp < (NOW() - INTERVAL 5 MINUTE) AND a.username='$uname' AND u.username=a.username")or die(mysql_error()); if (mysql_num_rows($query) > 0){ //somthing to filter out online peeps } else { //show offline peeps echo "<tr>\n"; echo "<td><a href=\"userinfo.php?user=$uname\">$uname</a><br></td>\n"; echo "<td> </td>\n"; echo "<td>$email</td>\n"; echo "<td> </td>\n"; echo "<td align=\"left\">\n"; /*displayStatus();*/ echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; } } } also is it possible to call a function inside of a function?
-
I have a active_users table, that tells all the online users. and just a regular table called users, that has the name, id, password, email, about, age, and so on..
-
nothing it shows all members, offline and online.
-
I want to filter out all the online people, I have been messing around with this: <?php /* Display table contents */ $query = mysql_query("SELECT u.username FROM users u INNER JOIN active_users a ON a.username=u.username WHERE a.timestamp < (NOW() - INTERVAL 5 MINUTE) AND u.username='$uname'")or die(mysql_error()); if (mysql_num_rows($query) > 0){ //somthing to filter out online peeps } else { echo "<table width=\"550\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n"; //Table's Specs echo "<tr>\n"; echo "<td valign=\"bottom\"><strong>Username</strong></td>\n"; //Username Column echo "<td width=\"80\" valign=\"bottom\"> </td>\n"; //Table Spacer echo "<td valign=\"bottom\"><strong>Email</strong></td>\n"; //Email Column echo "<td valign=\"bottom\"> </td>\n"; //Table Spacer echo "<td valign=\"bottom\"><strong>Status</strong></td>\n"; //Status Column echo "</tr>\n"; echo "<tr>\n"; echo "<td height=\"1\" colspan=\"5\" align=\"center\" valign=\"top\"><div class=\"dot\"></div></td>\n"; //Dotted Line echo "</tr>\n"; for($i=0; $i<$num_rows; $i++){ $uname = mysql_result($result,$i,"username"); $email = /*mysql_result($result,$i,"email");*/ "$uname"; $time = mysql_result($result,$i,"timestamp"); echo "<tr>\n"; echo "<td><a href=\"userinfo.php?user=$uname\">$uname</a><br></td>\n"; echo "<td> </td>\n"; echo "<td>$email</td>\n"; echo "<td> </td>\n"; echo "<td align=\"left\">\n"; /* Tells the if they are online or offline */ $query = mysql_query("SELECT u.username FROM users u INNER JOIN active_users a ON a.username=u.username WHERE a.timestamp < (NOW() - INTERVAL 5 MINUTE) AND u.username='$uname'")or die(mysql_error()); if (mysql_num_rows($query) > 0){ echo "<font color=\"#04db04\">Online</font>"; } else { echo "<font color=\"#FF0000\">Offline</font>"; } } echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; } } ?> I am not sure on how to filter them out. Any help? also if I wanted to pull username, and timestamp from one table and add email for users from another table, would this be right? MySql query: $q = "SELECT username, timestamp " ."FROM".TBL_ACTIVE_USERS. "INNER JOIN".TBL_USERS."ON" .TBL_ACTIVE_USERS.username = .TBL_USERS.email "ORDER BY" timestamp DESC,username
-
print 'onmouseover="this.className='hover'">$counter</td>\n'; or print <<<JS onmouseover="this.className='hover'">$counter</td> JS; do not forget your <?php ?>
-
I thought this: <? instead of this <?php was shorthand
-
are you looking for this? site.com/page.php?link=page1 if so here ya go <?php //page.php $getlink = $_GET["link"]; if ($getlink == "page1") { echo "Hello This Is Page 1"; } elseif ($getlink == "page2") { echo "Welcome To Page 2"; } else { echo "Ooops! Page Not Found"; } ?> or if you are trying to take the page from a remote site, then I guess you could try a include <?php include ("http://www.0044.co.uk/Tariffs/Global/calculate-ekit.asp?Action=compute"); ?> idk I am mostly new to php as well
-
is that right?
-
so is this right, if I want the username from one table, and email from another? SELECT username, timestamp FROM active_users INNER JOIN users ON active_users.username = users.email in MySQL $q = "SELECT username, timestamp " ."FROM".TBL_ACTIVE_USERS. "INNER JOIN".TBL_USERS."ON" .TBL_ACTIVE_USERS.username = .TBL_USERS.email "ORDER BY" timestamp DESC,username
-
how can I pull info from one table, then pull more info from another table? in my db, I have a table called users, that has all the info for users, then another one called active_users, that tells all the users that online well how can I pull the user name and timestamp from active_users, then pull the e-mail from users? I think I would use inner join or something like that.
-
oh thanks for the heads up!