Jump to content

Function Problems


Monk3h

Recommended Posts

My script works fine untill i try and see if somthing is == to a variable.

 

<?php 

include ("header.php");

function idcheck($id) {

$check = mysql_fetch_array(mysql_query("SELECT * FROM `alphaground` WHERE `id` = '$id'"));

if ($check[ownerid] = $stat[id]){

Print "<img src= images/keyyou.png>";

}else{

Print "<img src= images/keyneu.png>";

}}

?>

 

 

 

if ($check[ownerid] = $stat[id]){

 

Thats the problem part, my ID is 1 and i own 1 land, when i replace $stat[id] with my ID is shows the land i own on the map.

 

When i use $stat[id] (which gets the ID of the user which is me) it dosnt work.. :S

 

When i Print $stat[id] it prints my ID, so my problem will be that im using an incorect syntax inside of a function maybie?

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/111848-function-problems/
Share on other sites

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.