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
Share on other sites

this

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

 

should be

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

 

Link to comment
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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