Jump to content

Nexy

Members
  • Posts

    119
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Nexy's Achievements

Member

Member (2/5)

0

Reputation

  1. Thank you very much! Learned some new keywords
  2. Hello! I need help making a query for this statement: Drinkers who frequent exactly one of the bars which Joe frequents The table looks like this: --------------------------------------------- | drinker | bar | --------------------------------------------- | Mike |A.P. Stump's | | Bob |Blue Angel | | Erik |Blue Angel | | Herb |Blue Angel | | Jesse |Blue Angel | | Joe |Blue Angel | | John |Blue Angel | | Justin |Blue Angel | | Mike |Blue Angel | | Rebecca |Blue Angel | | Tom |Blue Angel | | Vince |Blue Angel | | John |Cabana | | Mike |Cabana | | Vince |Cabana | | Joe |Caravan | | John |Caravan | | Tom |Caravan | | Bob |Coconut Willie's Cocktail Lounge | | Joe |Coconut Willie's Cocktail Lounge | | Rebecca |Coconut Willie's Cocktail Lounge | | Justin |Gecko Grill | | Rebecca |Gecko Grill | | Herb |Seven Bamboo | | Vince |Seven Bamboo | | Mike |The Shark and Rose | --------------------------------------------- I can't seem to understand the logic that is needed to build the query. I started with this: SELECT DISTINCT * FROM frequents F1 WHERE NOT EXISTS (SELECT * FROM frequents F2 WHERE F1.drinker = 'Joe' AND /* Something here */); The way I'm reading is that my NOT EXISTS sub query should have Drinkers who like SOME of the bars which Joe frequents then somehow turn that into only one. How should I proceed? Any help would be appreciated! Thanks in advance!
  3. Thank You, I'll play with it and see what happens.
  4. Thanks for the reply, all that did was move it down with < p >, it's still not on the bottom. You said, you couldn't login to the forums. It's actually a PM layout. You can login with Iori/testtest. You will notice you have 1 "PM(1)". http://divnx.net Here's what I did to the code: <table class='margin'> <tr> <td style='vertical-align: top'> <div class='pm_msgbody'> <p>Test</p> Avatar <p>Gold | Rep</p> </div> </td> <td style='vertical-align: top'> <div class='pm_msgtext'> <div style='border-bottom: 1px solid #000; margin: 0'> PM Topic --- Date </div> <div style='text-align: left; padding-bottom: .4em'>Message</div> <div class='pm_msgans'> <p class='left'>Quote PM | Ping Shoutbox</p> <p class='right'>Delete | Reply</p> </div> </div> </td> </tr> </table> Unless I misunderstood your explantion, it didn't seem to work. Also, if I was unclear before, I always want this to appear on the bottom and only move more down if the message is long enough. Thank You!
  5. Why Hello There! I've tried countless way to do this: From the red rectangle on top, I want it so its always on the bottom rectangle. Of course there is no way of knowing how big the message above will be. So as the message grows the red rectangle goes more down as well. Here's the code: <table class='margin'> <tr> <td style='vertical-align: top'> <div class='pm_msgbody'> <p>Test</p> Avatar <p>Gold | Rep</p> </div> </td> <td style='vertical-align: top'> <div class='pm_msgtext'> <div style='border-bottom: 1px solid #000; margin: 0'> PM Topic --- Date </div> <div style='text-align: left; margin-bottom: .4em'>Message</div> <div class='pm_msgans'> Quote PM | Ping Shoutbox <div class='pm_msgrep'> Delete | Reply </div> </div> </div> </td> </tr> </table> And the CSS: .margin { margin-left: auto; margin-right: auto; } .pm_msgbody { width: 180px; color: #ADD8E6; font-size: .9em; } .pm_msgtext { width: 500px; color: #ADD8E6; font-size: .9em; padding: .2em; } .pm_msgans { text-align: left; border-top: 1px solid #000; } .pm_msgrep { display: inline; margin-left: 19.8em; } The part I want moved down is: <div class='pm_msgans'> Quote PM | Ping Shoutbox <div class='pm_msgrep'> Delete | Reply </div> Any help would be appreciated. Thank You!
  6. Why Hello There! I have this code: <?php $sql = "SELECT count(*) FROM pm_inbox WHERE status = 'Unread' AND user = '".$_SESSION['user']."'"; $res = mysql_query($sql) OR die(mysql_error()); $db = mysql_fetch_array($res); echo $db[0][0]; ?> The problem starts after 9 entries. If there are 10 entries, it echoes the number 1, if there is 20, it echoes 2, and so on. Just wondering how do I fix this, so it shows numbers after 9? Any help would be appreciated. Thank You!
  7. Thank You, both of you!! Both methods worked perfectly. :) :)
  8. Why Hello There! How would I be able to something like this: if($text contains a specific word == "word1" && $text contains another specific word == "word2") { do something; } Basically, if word1 and word2 are in the variable $text in respective order, then do something. Also, $text can contain any other words in there too. So if there was something like this: $text = "Hello word1 there! Welcome to word2 today!"; Then the if statement would see those 2 words are in there in order. But if it's something like this: $text = "Hello word2 there! Welcome to word1 today!"; Then do nothing, since "word1" is not first. I hope that made sense. Any help would be appreciated. Thank You!
  9. Yes, I do. But it didn't work the way I did it. I replaced $pm_set = "1"; with $_SESSION['pm_set'] = "1"; and the other with "2". And it didn't display anything under the echo.
  10. Why Hello There! Just wondering how I would save a variable even after you change pages. I have this: <?php if($_POST['pmsend'] && $_GET['do'] == "mod") { $sql = "SELECT username FROM users WHERE username = '$pmuser'"; $res = mysql_query($sql) OR die(mysql_error()); if(!empty($pmuser) && !empty($subject) && !empty($message) && mysql_num_rows($res) == 1) { $pm_set = "1"; if($_SESSION['user']) { mysql_query("INSERT INTO pm_inbox(user, sender, subject, date, message, status) VALUES('$pmuser', '".$_SESSION['user']."', '$subject', '".date('m-j-Y')."', '$message', 'Unread')"); mysql_query("INSERT INTO pm_draft(user, sender, subject, date, message, status) VALUES('$pmuser', '".$_SESSION['user']."', '$subject', '".date('m-j-Y')."', '$message', 'Unread')"); } else if($_COOKIE['user']) { mysql_query("INSERT INTO pm_inbox(user, sender, subject, date, message, status) VALUES('$pmuser', '".$_COOKIE['user']."', '$subject', '".date('m-j-Y')."', '$message', 'Unread')"); mysql_query("INSERT INTO pm_draft(user, sender, subject, date, message, status) VALUES('$pmuser', '".$_COOKIE['user']."', '$subject', '".date('m-j-Y')."', '$message', 'Unread')"); } } else if(empty($pmuser) || empty($subject) || empty($message) || mysql_num_rows($res) == 0) { $pm_set = "2"; } } if($pm_set == "1") { echo "<div class='create' style='width: 495px; padding: .2em; color: #00FF7F'> <img src='images/update.ico' alt='' /> Your Message to " . $_SESSION['suser'] . ' has been sent! </div>'; } else if($pm_set == "2") { echo "<div class='create' style='width: 495px; padding: .2em; color: #CD5C5C'> <img src='images/remove.ico' alt='' /> Your message has encountered a problem! </div>"; } ?> When you click submit on the form, it takes you to index.php?page=PM&pg=send&do=mod. After that it takes you back to index.php?page=PM&pg=send. But, once you change pages, I'm guessing the variable $pm_set doesn't have those values any more. Since it doesn't have those variables, it doesn't echo the what is set under them. I tried using a session, but it still didn't display. My question is; is there any way I can save that variable's value once it changes pages and comes back and it shows the message? I did this, to stop the user from pressing refresh and inserting the same thing more than once. I had <form action='index.php?page=PM&pg=send'>, but your still able to press refresh and insert multiple entries of the same thing. I can't use PHP_SELF because this is an included inside of index.php, so it would take me back to the main page. Any help would be appreciated. Thank You!
  11. NVM, I figured it out. Instead of innerHTML it had to be value.
  12. Oh wow, another stupid mistake D:! Thank You!
  13. I ran into another problem. :'( <?php if($_SESSION['user']) { $sql = "INSERT INTO pm_inbox(user, sender, subject, date, message, status) VALUES('$pmuser', '".$_SESSION['user']."', '$subject', '".date('m-j-Y')."', '$message', 'Unread')"; $res = mysql_query($sql) OR die(mysql_error()); $sqld = "INSERT INTO pm_draft(user, sender, subject, date, message) VALUES('$pmuser', '".$_SESSION['user']."', '$subject', '".date('m-j-Y')."', '$message', 'Unread')"; $resd = mysql_query($sqld) OR die(mysql_error()); } ?> The 2nd sql statement doesn't work. It inserts fine in the first one to pm_inbox, but it doesn't go into pm_draft. Any ideas? Thank You!
×
×
  • 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.