Jump to content

Ugluth

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by Ugluth

  1. Movies is the main table, which has a movie id as primary key, and also has a category field which contains the category id. The category field is foreign key to the movies table, mapping to a table called categories, which has an id. I hope this made sense.
  2. Hmm i can't use that in the query as it is, i tried putting a variable to the query window, which had as runtime value $_POST['CategMen'] but it still doesn't work as its supposed to, ty for the help though
  3. Would you like the code of the rest of the page as well or some other info about the situation?
  4. If i'm not mistaken this is what you asked for <form id="form1" name="form1" method="post" action=""> <label>Categories <select name="CategMen" size="1" id="CategMen"> <option value=""></option><?php do { ?> <option value="<?php echo $row_Categories['Category_ID']?>"><?php echo $row_Categories['Category_Name']?></option> <?php } while ($row_Categories = mysql_fetch_assoc($Categories)); $rows = mysql_num_rows($Categories); if($rows > 0) { mysql_data_seek($Categories, 0); $row_Categories = mysql_fetch_assoc($Categories); } ?> </select> </label> </form>
  5. Hello, i got a question. First of all i'm using wamp server 2.0 on windows xp sp2 platform and dreamweaver 8.0 edition. I have a database on the wamp server on mysql and i've made a connection through dreamweaver which works fine. Now the thing is i wanna make a display page that has a dropdown list where you can choose a movie category (the database is for a videoclub) and once you choose it from the dropdown list you get the responding table with the movies. My problem is that i don't know how to set the query on the table that will be showing the movies to match the value of the dropdown list. More specifically i need to know what to set on the WHERE. It should look like Movies.category = dropdownlist.value or something similar, but i dont know what exactly and i haven't been able to find anything for it on the internet. Please help if you can and thanks in advance! P.S. Here's the query i'm using if it helps SELECT movies.Movie_Name, movies.Release_Date, movies.Movie_Medium, movies.Rental_Time, categories.Category_Name FROM movies, categories WHERE movies.Movie_Category = '?' the '?' is the thing i'm missing
  6. Thank you very much To be honest i didn't really want it to be stored in a variable, just thats the way the book i'm reading, had it in that form. Btw since i already posted, could actually do another question. This is the book i'm reading to learn some basic php stuff http://www.techotopia.com/index.php/PHP_Essentials, since i've only worked just a little bit with asp .net 2.0 and i'm kinda new to web development. I think its kinda outdated or something because in some cases examples it uses, i just try them out and they just don't work. If you have a better suggestion for a book to read to learn some stuff for php it would be more than welcome. For the info i've downloaded wamp2 to test out the examples (just in case that does play a role). Thanks again for your help
  7. Hello there, this is my first post and let me start by saying that this is a really helpful and nice forum. Well let me get to the question. I'm reading a book to learn some basics of php and i've come across the printf function. The book said that to show a hex number u gotta use %x or %X. Anyway here's what i wrote: <?php $myString = "Blue"; $hex = 10; $formatted = printf ("My favorite color is %s and my lucky number is %x.", $myString, $hex); echo $formatted; ?> The result i get is "My favorite color is Blue and my lucky number is a.51" What is that 51 in the end? Sorry if this question is answered in another thread, but i looked a little bit and didnt find the answer.
×
×
  • 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.