Jump to content

Kelset

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Everything posted by Kelset

  1. Not really sure for I have not done a whole lot with sessions. Displaying the user name on the page would not be to hard since you already put it into the session. Just call it up from the session() where you want to use it. As for you link changing problem I would make set a session to a link type. Once they log in I would check to see what link type they are using and use PHP to display a menu of links from a include file. Not sure if I made any sense there or not... I guess it would depend on how many different link set ups you have. I hope this helped in some weird way. Cheers! Stephen
  2. Hey all! Well this might sound really simple but I have not been able to firgure it out and thought I would ask you find folks. What I'm doing is querying a MySQL database and getting results then looping through the results. //Sample of my code $query = "SELECT * FROM there"; $result = mysql_query($query); Ok here is where I don't understand, I use the while loop to loop through the results which looks like this //Sample of my code while ($row = mysql_fetch_array($result)) { Now I want to check and see if anything is in results I tried //Sample of my code if (!$results) { } but this does not seem to work for me, I'm assuming something always gets passed back even if null. So I tried something like the follow code //Sample of my code $row = mysql_fetch_array($query); if (!$row) {     //Display message }else{     while ($row = mysql_fetch_array($result)); { } Now I know I'm over writing the var $row but I thought this would not matter, even if it was bad coding. This works but the first record does not display when I do it this way. So do I have to use a for() loop? get the number of rows and loop with for(). Just thought I would ask and see what people thought or how maybe some of you loop through your results. Cheers! Stephen
  3. Kelset

    Query Help

    This seems to do the trick thank you so much. I was wondering how I was going to do this and even tried your code but with out the brackets (doh!). Again thanks for the help, if you have time maybe explain it to me. Cheers! Stephen
  4. Kelset

    Query Help

    Hello All! I hate to be bugging you folks but I have a newbie question that I can not seem to figure out. I have a DB with fields (name,dis,S,F,W,state) the S,W,F are set to enum ('true','false'). Ok now the query I need to run on this is what has me going insane. I would like to query where the dis equals someting and the state equals and the F or W or S egual somthing. I know I am not explaining this very well and for that I am sorry. Here is as far as I can make it :( $query = "SELECT * FROM tableName WHERE dis='value' and state='value'" the above is simple and works great but I get the values for S,W,F from an array so there might be a S and a W. So I would like to see all the jobs that have dis='value' and state='vale' and have either a S or a W='true' Maybe I'm just dreaming of the impossiable, sure hope not :( Any help would be great and thank you for you time in helping me Stephen
×
×
  • 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.