getting the id from one table, putting it in another

Since your taken care of, I'll go ahead with my problem.

I'm farely new with php, but not stupid.

When I query information that was submitted into a database prior, my result is: Resource id #3

I used to remember what to do in this situation, but I completely forgot somehow. Someone please help me out.
 
Resource id #3 -?????????

HM?!?! You try to put link indefiner into the data base!
like
Code:
<?
$user="flashsoft";
$pass="me";
$host="localhost";
$database="flashsoft";

$link=mysql_connect($host, $user, $pass);
mysql_select_db($database);


mysql_query("INSERT INTO `table` (`link`) VALUES ('$link')"; // here is problem
// just change a var name

?>


regards...
 
I'm sorry but your going to have to be more specific. :lol:
 
I did not undestud you. (BAD ENGLISH =( )

Resource id #3 - this is link of the mysql connection... so can not put it into data base =(.
 
Yes, I know that. I haven't been trying to put that into the database. I previously entered numbers, they entered just like they should, they are there. When I query them I get that: Resource Id #3, and I dont know what to do from there.
 
Goober said:
When I query them I get that: Resource Id #3, and I dont know what to do from there.

Your vars have same names like link indentifier... may be...

Show me please a sours file, i after that I tell you where i mistake...
 
Code:
$link = mysql_connect( "$dbhost","$dbuser","$dbpass" );
 if ( ! $link )
   die( "You did something wrong.  You are very stupid.  Fix it.<br>" );
		 
$select = mysql_select_db( $dbname ) or die ( "You did something wrong.  You are very stupid.  Fix it.<br>" );

$result_wins = mysql_query( "SELECT sum(wins) FROM record" );
$var = mysql_fetch_array($result_wins);      
			if ($var == $four)  
		  echo $var;

Thus, when I echo $var, I get "Array". :roll:
 
Try something like this:
Code:
$result_wins = mysql_query("SELECT SUM(wins) AS wins_total FROM record") or die(mysql_error());
$var = mysql_fetch_array($result_wins)
if ( $var['wins_total'] == $four )
    echo $var['wins_total'];

When you are calling mysql_fetch_array, you are getting an array of all the fields in the current record, you have have to tell it which one. See if this works.

Will
 
OMFG....I love you so much. If I ever meet you in person, I'll molest you... :lol:
 
Back
Top