-
Posts
131 -
Joined
-
Last visited
Everything posted by pro_se
-
Parse error: parse error, unexpected T_DOUBLE_ARROW in /var/www/dev.php on line 32 32: if ($time => $mem) {
-
i dont think i am looking for how to display it... i am looking for how to insert it and how it will run out with time...
-
yeah but that is just looking up the thing and its not going to expire (like with the time)
-
i want online and offline... sorry if i was not clear... oops...
-
its on a local server so i will attach it... the sql dump: CREATE TABLE `users` ( `status` varchar(255) NOT NULL default 'working', `rel` varchar(255) NOT NULL default '', `orient` varchar(255) NOT NULL default '', `gend` varchar(255) NOT NULL default '', `id` int(10) NOT NULL auto_increment, `name` varchar(20) NOT NULL default '', `username` varchar(40) default NULL, `password` varchar(50) default NULL, `regdate` varchar(20) default NULL, `email` varchar(100) default NULL, `website` varchar(150) default NULL, `location` varchar(150) default NULL, `last_login` varchar(20) default NULL, `fronttext` text NOT NULL, `headline` varchar(50) NOT NULL default 'This is my Headline', `counter` varchar(200) NOT NULL default '1', `avatar` varchar(60) NOT NULL default 'images/user/nopic.gif', `hobbies` varchar(255) NOT NULL default '', `music` varchar(255) NOT NULL default '', `reading` varchar(255) NOT NULL default '', `heroes` varchar(255) NOT NULL default '', `mstatus` varchar(255) NOT NULL default '', `inout` varchar(50) NOT NULL default 'out', `fname` varchar(255) NOT NULL default '', `lname` varchar(255) NOT NULL default '', `showdetails` char(1) NOT NULL default 'n', `showgeneral` char(1) NOT NULL default 'n', `last_activity` varchar(255) NOT NULL default '', PRIMARY KEY (`id`) ) [attachment deleted by admin]
-
ok and i put that into all the rows in the table and it did not display any of the people... and im sure it has not been 15 min's yet??? ???
-
oh... because its not working... i used [code]<?php $time2 = time(); echo "$time2"; ?>[/code] and got the time... and put that into the table...in all rows and it did not display anything...
-
can u tell me what [b]'$time = time() - 60 * 15;'[/b] does?
-
ok cool... i will try...
-
how would i insert that? can u give me more details on the table layout?
-
i dont want numbers i want names... you know like on myspace? when a user log's in an image changes...
-
hiya! i am working on a web community and the last project i have to tackle is the online now image. i was wondering if anyone in this genius bucket knows how to create a mysql/ php session online now thing. okay now some backend information -- the session is set when a user logs in, this session is called $_SESSION['username'];. also, when a user logs in a session variable gets set to 1 (meaning logged in) this variable is called $logged_in... hope thats enough information and all your input is greatly appreciated!
-
waaaaiiittt!!! i got it.... the error explains it all...
-
Warning: mysql_result() [function.mysql-result]: toid not found in MySQL result index 25 in /var/www/write.php on line 142 they are not being output... but everything else is getting put it...
-
i am trying to create a messaging system but i am running into some problems... here is the table format: CREATE TABLE `messages` ( `msgid` mediumint(9) NOT NULL auto_increment, `toname` varchar(255) NOT NULL default '', `toid` varchar(255) NOT NULL default '', `fromid` varchar(255) NOT NULL default '', `date` varchar(255) NOT NULL default '', `time` varchar(255) NOT NULL default '', `subject` varchar(255) NOT NULL default '', `message` text NOT NULL, `status` varchar(255) NOT NULL default 'msg', `fromname` varchar(255) NOT NULL default '', `read` varchar(255) NOT NULL default '** New **', PRIMARY KEY (`msgid`) ) and here is the php code: [code]<?php require 'db_connect.php'; if (isset($_POST['submit'])) { // if form has been submitted /* check they filled in what they supposed to, passwords matched, username isn't already taken, etc. */ $fromname = $_SESSION['username']; $result4 = mysql_query("SELECT * FROM users WHERE username='$fromname'"); while($r4=mysql_fetch_array($result4)) { $toid=$r4["toid"]; } $date = date('m d, Y'); $time = date('h:i A'); $name = "$fname $lname"; $ip = getenv("REMOTE_ADDR"); $id = $_GET['id']; $insert = "INSERT INTO messages ( toname, toid, fromid, date, time, subject, message, status, fromname) VALUES ( '".$_POST['to']."', '$toid', '$fromid', '$date', '$time', '".$_POST['subject']."', '".$_POST['message']."', 'msg', '$fromname')"; $add_member = $db_object->query($insert); if (DB::isError($add_member)) { die($add_member->getMessage()); } $db_object->disconnect(); ?> Message Sent, Thanks. <?php } else { // if form hasn't been submitted ?> <form name="form1" method="post" action=""> TO: <input name="to" type="text" id="to" value="<?php $msgid = $_GET['msgid']; $result = mysql_query("SELECT * FROM messages WHERE msgid='$msgid'"); while($r=mysql_fetch_array($result)) { $fromname=$r["fromname"]; echo "$fromname"; } ?>"> <br><br> FROM: <strong><input name="from" type="text" disabled="disabled" id="from" value="<?php $from = $_SESSION['username']; $result = mysql_query("SELECT * FROM users WHERE username='$from'"); while($r=mysql_fetch_array($result)) { $username=$r["username"]; echo "$username"; } ?>"><br><br> </strong>SUBJECT: <input name="subject" type="text" value="<?php $msgid = $_GET['msgid']; $result = mysql_query("SELECT * FROM messages WHERE msgid='$msgid'"); while($r=mysql_fetch_array($result)) { $subject=$r["subject"]; echo "$subject"; } ?>" id="subject"> <br> <br> MESSAGE: <div align="left"> <textarea name="message" cols="69" rows="6" id="message"><?php $msgid = $_GET['msgid']; $result = mysql_query("SELECT * FROM messages WHERE msgid='$msgid'"); while($r=mysql_fetch_array($result)) { $message=$r["message"]; $date=$r["date"]; $time=$r["time"]; echo " ---- ORIGINAL MESSAGE: ---- $message"; } ?></textarea> <br> <BR> <input name="submit" type="submit" id="submit" value="Submit"> <strong><a href="messagecenter.php">CANCEL</a></strong></div> </form><?php } ?> </span> <span class=style2> </span> [/code] now, when i try to send a message it does not put the toid and fromid... i would really like to know how to insert that into the database... everything else inserts fine... but not the toid and fromid... i need to get that out of a different table called users...
-
ok thanks ** SOLVED **
-
WOW! thanks maan... i changed all the fields to integers... good help! patient too!
-
Error SQL query: ALTER TABLE `friends` ADD UNIQUE `friendid` ( `userid` , `friendid` ) MySQL said: Documentation #1071 - Specified key was too long. Max key length is 500
-
i dont understand.. :(
-
-- Table structure for table `users` -- CREATE TABLE `users` ( `status` varchar(255) NOT NULL default 'working', `rel` varchar(255) NOT NULL default '', `orient` varchar(255) NOT NULL default '', `gend` varchar(255) NOT NULL default '', `id` int(10) NOT NULL auto_increment, `name` varchar(20) NOT NULL default '', `username` varchar(40) default NULL, `password` varchar(50) default NULL, `regdate` varchar(20) default NULL, `email` varchar(100) default NULL, `website` varchar(150) default NULL, `location` varchar(150) default NULL, `last_login` varchar(20) default NULL, `fronttext` text NOT NULL, `headline` varchar(50) NOT NULL default 'This is my Headline', `counter` varchar(200) NOT NULL default '1', `avatar` varchar(60) NOT NULL default 'images/user/nopic.gif', `hobbies` varchar(255) NOT NULL default '', `music` varchar(255) NOT NULL default '', `reading` varchar(255) NOT NULL default '', `heroes` varchar(255) NOT NULL default '', `mstatus` varchar(255) NOT NULL default '', `inout` varchar(50) NOT NULL default 'out', `fname` varchar(255) NOT NULL default '', `lname` varchar(255) NOT NULL default '', `showdetails` char(1) NOT NULL default 'n', `showgeneral` char(1) NOT NULL default 'n', PRIMARY KEY (`id`) ) -- Table structure for table `friends` -- CREATE TABLE `friends` ( `userid` varchar(255) NOT NULL default '', `friendid` varchar(255) NOT NULL default '' )
-
can u give me an example of how to stop the user from adding the friend using the first method?
-
hey i recently made a post about a friend script.... i got that to work... thanks to everyone that helped out... now i need help to prevent a user to add a friend twice... if you did not read the last post the friend display works as follows... [code]<?php $userid = $_GET['id']; $result = mysql_query("SELECT * FROM friends WHERE userid='$userid' limit 4"); while($r=mysql_fetch_array($result)) { $friendid=$r["friendid"]; $result2 = mysql_query("SELECT * FROM users WHERE id='$friendid'"); while($r2=mysql_fetch_array($result2)) { $avatar=$r2["avatar"]; $name=$r2["name"]; echo "<table width=15% height=102 border=0 align=left cellpadding=3 cellspacing=0> <tr> <td height=102 align=center valign=top><a href=user.php?id=$friendid><img src=$avatar width=90 height=90 border=0 /><br /> $name </a></td> </tr> </table>"; } } ?>[/code] now i need to figure out how to prevent a user to add a friend twice...
-
[b]display[/b][code]<?php $userid = $_GET['id']; $result = mysql_query("SELECT * FROM friends WHERE userid='$userid'"); while($r=mysql_fetch_array($result)) { $friendid=$r["friendid"]; $result = mysql_query("SELECT * FROM users WHERE id='$friendid'"); while($r=mysql_fetch_array($result)) { $avatar=$r["avatar"]; $uname=$r["uname"]; echo "<table width=15% height=102 border=0 align=left cellpadding=3 cellspacing=0> <tr> <td height=102 align=center valign=top><a href=user.php?id=$friendid><img src=$avatar width=90 height=90 border=0 /><br /> $uname </a></td> </tr> </table>"; } } ?>[/code] so i thought about it and this is what i came up with... and it works!!!! but it only displays one avatar... :( hEEELllPPPP... it must be somthing small...
-
i know how to insert it i dont know how to display the thing... its two tables coming together... users and friends...
-
user [b]A[/b]. $_SESSION['username']; user [b]B[/b]. $_GET['id'];