Hi there I am a php noob needing help. I am currently doing coding for my project, which is a hotel website. One of the hotel facilities is a spa and we have multiple spa rooms with different timeslots, as such it wasn't possible to store all the information into 1 big table because of repeating values(multiple timeslots for the same room number). Thus we have created separate tables for each spa room In our spa room booking interface, the user have got to select the types of room that they want and based on this, the data they entered into the form will be appended into the corresponding table. Does anyone how to code the PHP script to achieve this logic? To give clearer picture-- e.g. If user select Room type A the other data he entered(e.g. timeslot and name) will be appended into the table designed to hold information of user who select room type B. If room type B selected, another table will store the user information instead So how to achieve this? use if-else statement? If possible maybe can show a sample code here. Thanks!
You can put a variable into another variable. This is one of the first things you should've learnt in PHP. $foo = "Joe"; $bar = "My name is $foo."; echo $bar; Code (markup): This will echo: My name is Joe.
I thought it would've been obvious. Assuming the user input is coming from $_GET or $_POST, you could use those variables in your query. Otherwise, where is the user input coming from?