php - $_GET with MySQL query -


here code:

if ($_get['u'] == $userid) { $query = mysql_query("select * table uuserid='$userid'");  } 

the $userid variable defined in rest of script , works properly.
script script.php , works correctly (it's table shows rows table toondb). however, there column in table called uuserid. userid '1'. so, if type...

script.php?u=1 

i need show rows in database uuserid='$userid' working when type script.php?u=1 however, user 620 has rows in db , when type script.php?u=620 blank results. help, please? maybe it's problem query above :)

-- update: variable own userid

$userid = ($vbulletin->userinfo['userid']); 

therefore, $userid 1 me because userid 1. ugh, doofus right now. how can make so, if type script.php?u=620.. plugs 620 clause , show rows in table uuserid=620

thanks!

that if means query executed if url param == current logged in user, i'd rid of that.

<?php //...  if (ctype_digit($_get['u'])) {     $query = mysql_query("select * toondb uuserid={$_get['u']}");  }  ?> 

the mysql functions deprecated, start using pdo :d


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -