Jump to content

ShaolinF

Members
  • Posts

    314
  • Joined

  • Last visited

    Never

Everything posted by ShaolinF

  1. Thanks, it worked. I want to do another thing. What I want to do is once the dropdown is loaded, the user can select whichever option he wants and it will automatically load the DB values for that option into some text boxes. How would I go about doing that ?
  2. Hey Guys, I want to grab some data from my table and then output it into a dropdown list. I've got the data, I just dont know how to output it into the list. This is what I have done so far: <? //SELECT Data $result = mysql_query('SELECT eventName FROM event'); //Error Check if (!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $result; die($message); } // Output Data while ($row = mysql_fetch_assoc($result)) { ?> <select name="event">Select Event to Edit: <? <option value="1">Text that will appear in the choices</option> ?> </select>
  3. I have decided not to allow registrations. The process is short and simple and I'll just keep it that way. Thanks for the help though guys.
  4. Ok, but if user A registers with jack@hotmail.com - Then another user decides to reg a second account under jack@hotmail.com (you know some people and fake emails :-\). Now if User A requests his password, who's details will he recieve ? His or the other dude's ? You have 2 different users with the same email.
  5. Thanks cooldude. I think whats kind of confusing is if they dont reg then i will have most of their details anyway. and if they purchase tickets again then how will I allow them if they for example use the same email add (email being unique key) ? Below is what I have done for the user table, suggestions: CREATE TABLE user ( userId integer auto_increment NOT NULL, name varchar(100) NOT NULL, contactNo varchar(12) NOT NULL, email varchar(80) NOT NULL, gender varchar(1) NOT NULL, Registered tinyint(0) NOT NULL, username varchar(40) default NULL, password varchar(40) default NULL, moderator tinyint(0) NOT NULL, administrator tinyint(0) NOT NULL, disabled tinyint(0) NOT NULL PRIMARY KEY (userId), UNIQUE KEY username (username), UNIQUE KEY email (email) ) Im not sure if I should keep the admin/mod in the same field on in a different table. Suggestions ?
  6. Thanks. How comes you used single quotes around the column names ?
  7. Excellent. I wanted to know, can you have more than 1 foreign key in a table ?
  8. Hey guys, I am working on my table structure and am alittle stuck on what to do. The user has the ability to reg himself, and if he doesnt then his details wont be saved but his transaction will. Now, when I store the transactions for regged and unregged users should I store them in different tables ? See the tables below: As you can see, the following table would only work if the user was registered. But now the question is how I should store events for unregistered users. So far it looks like I will need to create a seperate table.
  9. Hi Guys, If I wanted to unset a session variable what would I need to do ?
  10. can you give me an example please ?
  11. I run the code and I get the following: Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' ticketAmount = 122, ticketPrice = 1.22' at line 1 Whole query: //Error Check if (!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $result; die($message); }
  12. Hey guys, I have 1 records in a table called events with 3 coloumns called eventName, ticketAmount and ticketPrice. I am trying to UPDATE this table with the following statement but it is not working: //UPDATE Data $result = mysql_query("UPDATE event SET eventName = $_POST['eventnm'], ticketAmount = $_POST['tickno'], ticketAmount = $_POST['tickprice']");
  13. Hey guys, Whats the difference between the two ?
  14. Thanks. How do I validate ? and what does isset mean ?
  15. Hi, I have the 3 following radio boxes and I want to add whichever one is selected into a session, how would I do this ? <input type="radio" name="group2" value="Water"> Water<br> <input type="radio" name="group2" value="Beer"> Beer<br> <input type="radio" name="group2" value="Wine" checked> Wine<br>
  16. Well Im using $_SESSION if thats a server variable..
  17. Thanks. Ok, earlier on I mentioned that I wanted my ID numbers to be complete random numbers rather than incremented. Well, I have plans of putting a system into place where current registered users enter their ID into a textbox and it will display their reg. details. The problem with incremented IDs is someone could probably 'guess' the number (or atleast increases its chance with a incremented ID). The reason I only want them to beable to enter IDs is to make things quicker, its not a large system and its only to purchase tickets (for university events). Whats your take on this ?
  18. It works now: number_format($_SESSION['TICKET'] * 3.50,2);
  19. Thanks, what if I wanted to round it off at 2 decimals ?
  20. Thanks. So would I create a relationship with the two tables though the same ID ? Correct ? Here is an example set of tables: table 1 UserID, name, age, gender, table 2 UserID, ProductName, purchase ID, quantity, unit price, total. So if I wanted to display UserId, name, productname, quantity, total - how would I do that ?
  21. Hey Guys, How can I multiply 2 digits ? I have a $_SESSION['var'] and £3.50 which I need to add.
  22. Why would you say that ?
  23. Lol, I was checking out paypal's site and yes they can send back alot of data, which now means I must postpone the DB creation untill I can get a better view of all the table structure.
  24. Well the thing is, they fill in a small form and press next where they are redirected to paypal. They choose how many tickets they want on the paypal system. Their is little control over what data I can extract from paypal. So the timeOfReg can be the purchase date, or maybe I could add another timeOfPurchase field ? They will recieve a confirmation email from me once they have submitted and also a receipt from paypal. Is it ok if you could go through the create statement and correct any errors in it for me please ? Im quite new to SQL and still have a long way to go. And thanks for your suggestions, some thought provoking questions.
×
×
  • 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.