Shoutbox

Further PHP / MySQL Help - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Further PHP / MySQL Help (/showthread.php?tid=90386)

Further PHP / MySQL Help by Eddie on 04-27-2009 at 05:38 PM

I know i have asked a lot of questions here, but its teaching me new things, and you guys seem to know everything that i need to learn, and i can answer my questions myself.

I have two MySQL tables in my database;
itzeddie_pilot
itzeddie_flights

Both the tables have a varchar called "rank". I am viewing a route page, i need a php code to check the rank on the pilots table where the callsign currently in use (pilots id assuming im logged in), and then check the currently viewed flight rank is the same and if they are then it makes an echo of some random text.

Note; If anyone is willing to also add this, i have 7 other "columns" in my itzeddie_flights table, 'Monday, Tursday, Wednesday, etc'. If possible i would like it to check the current day and if also active marked by a "1" in the table then the text echo's.

I would find a way of doing it myself, or find a new method, i however i am quite tired, and it would be easier to learn the right way from you folks.


RE: Further PHP / MySQL Help by davidpolitis on 05-01-2009 at 02:26 PM

Would something like this start you off?

PHP code:
<?php
$id = "blah1" // Replace with Flight ID being viewed
$rank = "blah2"; // Replace with logged in user's rank
$rs = mysql_query("SELECT rank FROM itzeddie_flights WHERE id='{$id}'");
 
if(mysql_result($rs, 0, "rank.itzeddie_flights") == $rank)
{
  echo("random text!");
}
?>


P.S. I tried to really think about what you mean.
RE: Further PHP / MySQL Help by MeEtc on 05-01-2009 at 08:23 PM

Find me on WLM sometime in the next 6-8h and I'll give some help


RE: Further PHP / MySQL Help by Eddie on 05-02-2009 at 02:34 AM

quote:
Originally posted by MeEtc
Find me on WLM sometime in the next 6-8h and I'll give some help
Unfortunately i have to go and fix a few computers, but i will send you an e-mail later. Thanks.