Jump to content

Mostly mysql questions joins or unions i think im stuck o.0


xoligy

Recommended Posts

Thanks to ProjectFear i managed to sort out all my other problems on my script after i changed a little bit of code but now i have these problems lol one day i'll get the hang of it... well maybe ::)

 

Oh i also would like someone to have a look at some code for me if they didnt mind and give me some advice on how to get it to work (third party) i have an idea just need a quick reply so if someone is online and dont mind me bothering them for 2 secs it be appreciated :)

 

Well fixed all my other problems after being awake for far too long but im having one or two problems here not sure whats up but then im no good with mysql or php lol. I think the below is self ex planetary but just incase it not then here is what im trying to do:

From userdetails I need the ID, userName, alliance then from Ranks I need the players rank

 

<?

$q="SELECT `UserDetails.ID`, `userName`, `alliance`, `rank` FROM `UserDetails`, `Ranks` WHERE `UserDetails.ID`=`Ranks.userID` AND `alliance`='$alliance'";

//echo "$q";

$r=@mysql_query($q) or trigger_error("Query: $q\n<br />MySQL Error: " . mysql_error);

if ($r){

$bg='#000000';

while ($row = mysql_fetch_array($r, MYSQL_BOTH)){
?>

the echo:

Notice: Query: SELECT `UserDetails.ID`, `userName`, `alliance`, `rank` FROM `UserDetails`, `Ranks` WHERE `UserDetails.ID`=`Ranks.userID` AND `alliance`='Test Alliance'

MySQL Error: mysql_error in /home/xoligy/public_html/Medi/alliance.php on line 95

 

I also need to know how to hide a link, textbox or whatever. Basically in the field alliances I have one called founder or owner I forgot, I want that user and that one only to be able to edit the alliance details how would I achieve this? Im guessing that I could use a solution to this as some kind of userlevel system too?

 

I also need something similar for this query:

$str="SELECT  userID,rank FROM `Ranks` WHERE rank<>0 AND active='1' ORDER BY `rank` ASC LIMIT $start,{$conf['users_per_page']}  ";

 

active is located in userdetails

 

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.