Jump to content

sean04

Members
  • Posts

    88
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male
  • Location
    Toronto

sean04's Achievements

Member

Member (2/5)

0

Reputation

  1. Hmm. I've run into a small issue. It seems that when I then reply to a message, that conversation then disappears. I think not having 'where to_user = $this->user_id' in the query causes this?
  2. Thanks for the help Barand. I appreciate it. The query works great! In your opinion though is this the right way to approach this? Should I have two different tables one for the start of new messages and one that holds the conversations if you reply? Then I can just join those two tables. Thanks!
  3. The problem is is that any message the doesn't have a reply to it yet has to show up and messages that have a reply to it the most recent has to show up. Any ideas? Thanks!
  4. Thanks for the response. Yes, I'm trying to make a continuous message system. When a new message is started it has a reply id of 0. A person can then reply to that message. Pretty much trying to attempt what Facebook does. One message should show in the inbox and that should be the last reply to you. When you click on the message you can then see all the conversation messages. I was pretty sure this is the way to do it but if there is another way please explain. Thanks for the help!
  5. I have a table as follows: id reply_id to_user from_user message date_sent ------------------------------------------------------------------------ 1 0 345 223 hey 2012-06-01 12:33:23 2 1 223 345 hey man 2012-06-01 12:37:23 3 1 345 223 how r u? 2012-06-01 12:45:23 4 0 223 345 sup 2012-06-01 13:17:23 5 4 345 223 msg 2012-06-01 13:37:23 6 4 223 345 msg2 2012-06-01 13:58:23 7 0 345 222 test 2012-06-02 09:33:23 How do I show the most recent message in a conversation and not all of them? Inbox should look like this... test 2012-06-02 09:33:23 how r u? 2012-06-01 12:45:23 msg2 2012-06-01 13:58:23 I've gotten close but I run into difficulties because any message with a reply_id of 0 needs to show up ONLY IF its never been replied to. If it has been replied to it shouldn't show up. Thanks in advance!
  6. Hey, I have a news ticker that I'm attempting to make look smoother but am having no luck. Code is as follows: $(function () { $('#listticker').hover(function () { clearInterval(runTicker); }, function () { runTicker = setInterval(newsticker, pause); }); }); function newsticker() { last = $('ul#listticker li:last').hide().remove(); $('ul#listticker').prepend(last); $('ul#listticker li:first').slideDown(1000); } var runTicker = setInterval(newsticker, pause); The original idea came from here: http://woorktuts.110mb.com/newstickerjq/index.html but this is modified for what I need. As of now "new" articles slide down from the top and the last leaves from the bottom. The whole animation just looks a little clunky. Can anyone improve what I got so far? Thanks in advance!
  7. Hey guys, I've been working with this rating system and I'm wondering if anyone can lead me in the right direction to make a read only or average set of stars. Can't seem to get around that. http://www.switchonthecode.com/tutorials/how-to-build-a-star-ratings-jquery-plugin Thanks, Sean
  8. pretty much copy a record but update one field in that record
  9. What I'm wondering is is there a way to update one field in a table while all the other fields in that table are the same as where you are copying it from? From my first example there could be 100 fields that need to be inserted to make a new record but the only field that needs actual changing is OfficeID. I need a query that wouldnt need me to enter all 100 fields to change a single field. Something like this INSERT INTO tbl_packages SELECT OfficeID, * WHERE OfficeID = 4100 I know the above is hard to understand because it doesnt make sense lol but i hope one of you will understand what im trying to do Thanks, Sean
  10. Thanks for all the comments guys. I will try this out on Monday and if I run into any problems I'll be back here Thanks, Sean
  11. So for example I have a table as such: PackageID OfficeID NumUsers 1 2333 55 2 2333 55 How would I go about writing a query that would copy that exact information for the Package Table but to a different OfficeID? So after I run the query the Package Table would be like this: PackageID OfficeID NumUsers Name 1 2333 55 Example 2 2333 55 Example 1 4100 55 Example 2 4100 55 Example This was my idea: $q1 = mysql_query ('SELECT * FROM tbl_packages WHERE OfficeID = \''.$_GET[OfficeID].'\''); while ($r1 = mysql_fetch_array($q1)) { mysql_query(' INSERT INTO tbl_packages ( PackageID, OfficeID, NumUsers, Name ) VALUES ( \''.$r1[PackageID].'\', \''.$_GET[OfficeID].'\', \''.$r1[NumUsers].'\', \''.$r1[Name].'\', ) '); Only problem is is that this way would take forever if there was 100 fields in the Packages table... maybe a subquery? Thanks, Sean
  12. Yes the connection works and the chdir. I do get a permissions error sometimes but I have full permissions. Any ideas?
  13. What I'm trying to do is copy all files from one server to another folder on another server. Here is what I have have so far.. <?PHP //connection settings $ftp_server = "server"; $ftp_user_name = "user"; $ftp_user_pass = "pass"; $dir = "/var/test/"; $destination_file = "/test/"; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // check connection if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftp_server for user $ftp_user_name"; exit; } else { echo "Connected to $ftp_server, for user $ftp_user_name"; } if (ftp_chdir($conn_id, $dir)) { echo " <br/>Current directory is now: " . ftp_pwd($conn_id) . "\n<p/>"; } else { echo "Couldn't change directory\n<p/>"; } $buff = ftp_rawlist($conn_id, $dir); foreach($buff as $files) { echo $files. "<br/>"; if (ftp_get($conn_id, $destination_file."test.file", $dir."test.txt", FTP_BINARY)) { echo "<br/>Successfully written to $destination_file\n"; } else { echo "There was a problem\n"; } ?> That doesn't work. Any ideas? Thanks, Sean
  14. Thank you both for your replies. mgallforever, it worked perfectly thanks! Thanks, Sean
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.