Jump to content

debcous

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

debcous's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi can anyone please help me?? i'm trying to pull data from my database and display this data in a drop down list. I have 3 drop down menus, when a sourcre is selected in the first menu...only the destinations available from that source should be displayed in the 2nd drop down and then the destinations of the next selection displayed in the 3rd drop down. If anyone knows how to do this can they please help me Thanks, Debbie
  2. [!--quoteo(post=367997:date=Apr 24 2006, 09:45 AM:name=shocker-z)--][div class=\'quotetop\']QUOTE(shocker-z @ Apr 24 2006, 09:45 AM) [snapback]367997[/snapback][/div][div class=\'quotemain\'][!--quotec--] change $query = "SELECT * FROM bus AND train where bus.source='$source' and bus.destination='$destination' and bus.travelday='$travelday' and train.source='$source' and train.destination='$destination' and train.travelday='$travelday'"; to $query = "SELECT * FROM bus,train where bus.source='$source' and bus.destination='$destination' and bus.travelday='$travelday' and train.source='$source' and train.destination='$destination' and train.travelday='$travelday'"; just needed , in place of AND and that should now work for you :) Regards Liam [/quote] i had that already but gave me the same error. does the rest of the statement look ok to you?
  3. <?php include "db.php"; $submit=$HTTP_POST_VARS["submit"]; $reset=$HTTP_POST_VARS["reset"]; $source =$HTTP_POST_VARS["source"]; $destination=$HTTP_POST_VARS["destination"]; $travelday=$HTTP_POST_VARS["travelday"]; $query = "SELECT * FROM bus AND train where bus.source='$source' and bus.destination='$destination' and bus.travelday='$travelday' and train.source='$source' and train.destination='$destination' and train.travelday='$travelday'"; $result = @mysql_query($query, $conn); if($result){ echo' <table align="center" cellspacing="0" cellpadding="5" bgcolor="white" border=0 bordercolor="#0099CC" font="white"> <td align="left" bgcolor="#0099CC"><center><font color="white"><b>Source</b></td> <td align="left" bgcolor="#0099CC"><center><font color="white"><b>Destination</b></td> <td align="left" bgcolor="#0099CC"><center><font color="white"><b>Departure Time</b></td> <td align="left" bgcolor="#0099CC"><center><font color="white"><b>Arrival Time</b></td> <td align="left" bgcolor="#0099CC"><center><font color="white"><b>Travel Day</b></td> <td align="left" bgcolor="#0099CC"><center><font color="white"><b>Operator</b></td></tr>'; while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ echo'<tr> <td align="center">'.$row['source'].'</td> <td align="center">'.$row['destination'].'</td> <td align="center">'.$row['dept_time'].'</td> <td align="center">'.$row['arr_time'].'</td> <td align="center">'.$row['travelday'].'</td> <td align="center">'.$row['operator_name'].'</td></tr>'; echo'</table>';} } else{ echo'<h1> System Error </h1> table '; exit(); } mysql_close(); ?> Hi...I'm trying to display details from 2 seperate tabels in my database onto the screen in the form of a table. Can someone please tell me if the code i am using is correct for this function. At the moment it is displaying 'system error'. I would really appreciate your help. Debbie
  4. Ì have actually gotten it to display out the image now by using [code] <img src="http://snet.wit.ie/~ciaracousins/clothes/'.$image.'[/code] but the problem is it is displaying out the very 1st image that I have stored in my db in every field. The prod name and price are different in every row but the image is staying the same? Any ideas why this is happening??
  5. thanks orio, I dont know why but it still wont work! When i view the source code it shows: [code]<img src="http://snet.wit.ie/~debcous/clothes/<?php echo $image; ?>" ></td>[/code]
  6. Thanks Andy. I am trying to display the images dynamically so I cannot hard code the full address. I have now changed it so that it is [code] <td align="center"><img src="http://snet.wit.ie/~debcous/clothes" ></td>[/code] how do I append the image field which stores the image name in my db to the end of it???
  7. I'm trying to display images in a table. The way that I have my images stored is that I have the name of the image stored in my database. I then have a variable ($imagepath) which stores the the directory of the image and the name of the image. [code] $imageDir = "http://snet.wit.ie/~debcous/clothes/"; $imagePath = $imageDir."".$image;[/code] . I am displaying details in the table as follows: [code] <td align="center">'.$row['.$imagepath.'].'</td> <td align="center">'.$row['prodName'].'</td> <td align="center">'.$row['price'].'</td> [/code] But it is not displaying the image. Any clues???
  8. [!--quoteo(post=366154:date=Apr 18 2006, 03:06 PM:name=Darkness Soul)--][div class=\'quotetop\']QUOTE(Darkness Soul @ Apr 18 2006, 03:06 PM) [snapback]366154[/snapback][/div][div class=\'quotemain\'][!--quotec--] If I understood it right, you want to allow the admin select one of the table listed on the drop, click submit and view the table data.. right? De option value is the right name of the table?? and want to show all tables in one page? I think its easyer to you make one page for each table view, and in that page, do a SELECT * FROM.. listing all data so, your form call a page lice check.php, in this one, the $_POST will redirect you to the page you want.. Any better idea? ^^ D.Soul [/quote] Do i need to use an if statement then to redirect it to the page i want? so if the admin chooses to view the contents of the bus table it will redirect them to a page that displays just the contents of the bus table?
  9. <form action="viewtables.php" method="post"> <center> <table> <tr> <td><font color="#0099CC"><b>Select Table:</b></font></td></tr> <tr><td><label> <select name="table" id="table"> <option value="auth_users">Members table</option> <option value="admin">Admin Details</option> <option value="bus">Bus Entries</option> <option value="train">Train Entries</option> <option value="operator">Operators</option> </select> </label> </table> </center> <center><input type="submit" name="submit" value="SUBMIT"/> </p> </center> <input type="hidden" name="submitted" value="TRUE"/> </form></font> <?php if(isset($_POST['submitted'])){ include "db.php"; $t = trim($_POST['table']); $query = "SELECT * FROM auth_users"; $result = @mysql_query($query, $conn); if($result){ echo' Hi...in the above code i am trying to allow the administrator to select a table from the database called "getmeth_login". The above code only displays the contents of the "auth_users" table. Can anyone show me how to display the contents of any of the tables selected in the drop down menu please?
  10. [!--quoteo(post=364375:date=Apr 13 2006, 07:48 AM:name=predator12341)--][div class=\'quotetop\']QUOTE(predator12341 @ Apr 13 2006, 07:48 AM) [snapback]364375[/snapback][/div][div class=\'quotemain\'][!--quotec--] what exactly do you mean is it that you want ppl to be made to login if they dont have access or is it something else? [/quote] There are sections of my site that are only to be accessed by members who are logged in. At the moment though if you copy and paste the url from an area where someone is logged in, and paste it into another browser you can access the logged in area without actually logging in. I want the user to be directed to my login screen if they try to visit an area which they should have logged in to access
  11. hi...just looking for some help in setting up session tracking to work on my website. At the moment if someone enters the URL for a logged in page they have full access to the page, i would like for them to be redirected to the main page and asked to login before accessing the login page. Any ideas on how i would do this??
×
×
  • 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.