Jump to content

Php Mysql Help needed!


ryanteck

Recommended Posts

Im trying to get a code to find an id by name and then find a value by id

this kinda works can you help?

<?php
$con = mysql_connect("localhost","root","password";
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("ryanteck", $con);

$result = mysql_query("SELECT * FROM forum_members
WHERE member_name='ryan'");

while($row = mysql_fetch_array($result))
  {
  echo $row['member_name'] . "s Id is " . $row['id_member'];
  echo "<br />";

  

$result2 = mysql_query("SELECT * FROM forum_themes
WHERE id_member= $id && variable= 'cust_uberis'");

while($row = mysql_fetch_array($result2)) or die (mysql_error());


  {
  echo $id . "Uber Island Is " . $row['value'];
  echo "<br />";
  }


}
?> 

Link to comment
https://forums.phpfreaks.com/topic/224812-php-mysql-help-needed/
Share on other sites

Sorry about not writing a full post, i had to go half way through.

Me and my friend are making a linking system to link his php game with my smf forum.

what i need it to do is first find the user id off the name ( first part ) which works. we then need it to use that id to find the value after searching for that id and variable.

thanks ryan

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.