Jump to content

ben1989

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ben1989's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. <?php $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); echo $hostname; ?> done it :)
  2. Thanks also what is it for to say mu hostname eg range23 @btibnbeg .con if u know what i mean :)
  3. sorry to post this but the search wont work with IP its under 3 caricters :( what is the $_GET to get the ip? thanks ben :)
  4. im gettin 1 result lol and an error You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE ID = '1'' at line 1
  5. hmm im havin a alittle truble were do i pu it coz i have just tryed and i get the same 5 times lol i am a bit off a newbi sorry
  6. [!--quoteo(post=386057:date=Jun 20 2006, 10:40 AM:name=Ferenc)--][div class=\'quotetop\']QUOTE(Ferenc @ Jun 20 2006, 10:40 AM) [snapback]386057[/snapback][/div][div class=\'quotemain\'][!--quotec--] Something like this would work, as long as the id's are numerical, and don't have gaps in them (1,2,5,6 will error periodicly). [code]<?php $sql = "SELECT * FROM members"; $result = mysql_query($sql)or die (mysql_error()); // get the total $total = mysql_num_rows($result) or die (mysql_error()); // get a random id from the data base.. $rand = rand(1,$total); $sql .= " WHERE q_id = '$rand'"; $rand_sql = mysql_query($sql) or die (mysql_error()); while ($output = mysql_fetch_array($rand_sql)){     echo $output['membername']."<br>";     echo $output['location'];      } ?>[/code] [/quote] hah ill try that thanks m8 exelent thnaks you just one last thing how can i do it so it dose it 5 times?? selects the random id 5 times and echos all 5 results? thanks -ben
  7. hi i have been registerd b4 but i forget all mi login stuff lol im building a php site but on the home page i would like it to pull rando info from a table the table is labed members and the rows are ID, membername, location, country, age, gender i would like it to randoly pull the id and display the info for that id if u know what i mean thnaks -ben need for info just ask :)
×
×
  • 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.