Jump to content

stewart715

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

stewart715's Achievements

Member

Member (2/5)

0

Reputation

  1. Makes sense. Any prebuilt scripts that you can think of? Thanks for your help.
  2. Anyone know how to approach a product select like this: http://www.kestrelmeters.com/custserv/info.jsp?pageName=Interactive_Product_Selector Where it displays all the products and then constricts it based on criteria specified... I've looked around and can't find anything. Thanks.
  3. [quote author=stewart715 link=topic=114205.msg464642#msg464642 date=1162946835] [code] <?php //date("i")-10 means 10 minutes ago $time = mktime(0, 0, 0, 0, 0, 0, date("m"), date("d"),  date("Y"), date("H"), date("i")-10, date("s")); $sql2 = mysql_query("SELECT * FROM users WHERE last_login < $time"); $mem2 = mysql_fetch_array($sql2); $numr = mysql_num_rows($mem2); ?>[/code] maybe? [/quote]
  4. Ok, thanks for your help I'm trying to get a list of pending friend requests (a pending friendrequest has a value of 1 for received) so example.. TABLE: buddylist uid  buddy  received 1      7          1 3      5          1 1      8          0 1      3          1 TABLE: users uid  name 1    mike 7      joe 3    john 8      bill so select select buddy from buddylist where recieved =1 and uid = 1(we'll use 1 for example purposes instead of $user->uid)...then the join will compare the outputted buddy value with uid in users and will output the name that goes along with that user..thats fine..$sql works perfect.. however.. i need to have a variable that outputs that buddies uid as well..i hope i explained it well so i'll need the following output (with the example of tables above) [code]<a href="7">Joe</a> <a href="3">John</a> [/code]
  5. All help is much appreciated :) Thanks. The code below outputs all usernames that have the match shown in $sql (in $row). However, I also need to output a persons uid along with $row. However, I don't know how to combine this: [code]<?php $sql2 = "SELECT buddy         FROM buddylist         WHERE received = 1         AND uid = 1"; $res2 = mysql_query($sql2) or die (mysql_error()); while ($row2 = mysql_fetch_row($res2)) {     echo "$row2[0]<br />"; } ?>[/code] WITH THIS: [code]<?php $sql = "SELECT u.name         FROM buddylist b         INNER JOIN users u ON b.buddy = u.uid         WHERE b.received = 1         AND b.uid = 1" ; $res = mysql_query($sql) or die (mysql_error()); while ($row = mysql_fetch_row($res)) {     echo "$row[0]<br />"; } ?>[/code] SO THAT: [code]<?php echo $row2[0]; echo $row1[0]; ?>[/code] will output all matches of both like so: 2 Mike 3 Joe 5 Frank etc... Any ideas? Please! All help is appreciated :)
  6. [code] <?php $time = mktime(0, 0, 0, 0, 0, 0, date("m"), date("d"),  date("Y"), date("H"), date("i")-10, date("s")); $sql2 = mysql_query("SELECT * FROM users WHERE last_login < $time"); $mem2 = mysql_fetch_array($sql2); $numr = mysql_num_rows($mem2); ?>[/code] maybe?
  7. hold on i completely misread lol
  8. what unit of time is in your database? it's minutes right?
  9. i understand but i was giving an example..to explain..im trying to get a list of a users pending friend requests..so it matches buddy with uid and when receieved =1 that means its pending..so i need to produce a list of pending friends names..which i have above..but i also need to make a link that goes to their profile..but i need their UID from a query to do it..thanks for all your help though i really appreciate it
  10. thanks. and i could add that as a link as [code]<a href="uid">name</a>[/code]?
  11. Thank you. how would I place that as $uid though or some variable?
  12. maybe you haven't closed it with the necessary ; or } post the actual code
  13. Post the code that is outputting only one result please
×
×
  • 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.