My program needs to select a username based on the criteria of the userid being 2. The database holds a table with fields userid and username. How do I access that table? The database is mysql.

8 Years
Discussion Span
Last Post by Josh Connerty

It is not for school it is for a program I am writing to create a PTC site where users are paid to view advertisers' ads. Got the connect problem figured out. I was using the wrong host, user, and password. But now I can't get the frame to show using the code:

mysql_connect("mysql503.opentransfer.com", "C258596_Laurie", "BetsyG123") or die(mysql_error());
mysql_select_db("C258596_windmill") or die(mysql_error());
$id = (int)$_POST['ad'];
$target = $db->query("SELECT target FROM ads WHERE id ='$id' LIMIT 1");
if($db->num_rows() < 1)
  {die('invalid ad id');}
list($target) = $db->fetch_array($target);
echo "database";
<frameset rows = "90,*">
  <frame src="accept_again.php?username=<?php echo htmlentities($_POST['username'], ENT_QUOTES); ?>&adid=<?php echo htmlentities($id, ENT_QUOTES); ?>">
  <frame src="<?php echo htmlentities($target, ENT_QUOTES) ?>">

I was using the frame with a different host and it worked but when I transferred to this host and altered the connection data the frame no longer worked.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.