Jump to content

grrwood

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

grrwood's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. you guys here in the forums are gods thank you. this works but like i butt head i could get it to work till i remembered the ; duh, oh well noob mistake $u = $_GET['u']; ended up leaving the code like this <?php // Connect to the database require("config.php"); // select database // Get users information $u = $HTTP_GET_VARS['u']; $result = mysql_query("SELECT * FROM `users` WHERE `userid` = $u LIMIT 1"); if (!$result) { echo("<P>Error performing query: " . mysql_error() . "</P>"); exit(); } while($r=mysql_fetch_array($result)){ // Turn breaks into new lines for biography field $r[biography] = nl2br($r[biography]); // Output users information echo "<b>Viewing $r[username]'s profile</b><br>"; echo "Biography: $r[biography]"; } ?> thanks again for the help you guys rock. and i will be sure to read more on _GET
  2. thanks for the help i really appretiate it added the line if (!$result) { echo("<P>Error performing query: " . mysql_error() . "</P>"); exit(); } Error performing query: 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 'LIMIT 1' at line 1 so im going to keep reading hopefully something come up
  3. ok lets see if i can explain this well. using a tutorial that can be found [a href=\"http://forum.overhauledpc.com/showthread.php?t=637\" target=\"_blank\"]here[/a] i compleated the 2 other tutorials no problem just added a line here and there but this one has got me. the error is as follow Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\easyphp\www\testplatform\profile.php on line 10 using a link like this [a href=\"http://localhost/testplatform/profile.php?u=1\" target=\"_blank\"]http://localhost/testplatform/profile.php?u=1[/a] the script is <?php // Connect to the database require("config.php"); // select database // Get users information $result = mysql_query("SELECT * FROM `users` WHERE `userid` = $u LIMIT 1"); [b]while($r=mysql_fetch_array($result)){[/b] // Turn breaks into new lines for biography field $r[biography] = nl2br($r[biography]); // Output users information echo "<b>Viewing $r[username]'s profile</b><br>"; echo "Biography: $r[biography]"; } ?> any help in this would be greatly appreatiated. as i have looked thourgh several sites tring to find the answer. then going through php databases with member listing to see how they pull up the members info. apache 1.3.33 php 4.3.10 mysql 4.1.9
×
×
  • 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.