That was silly mistake , I corrected it now its inserting values in table in every column its not taking values that I am filling in form , instead its inserting 1 every column ?
You should consider using Prepared Statements, because
you wouldnât have to quote variables by yourself, so this mistake would have given you an error message that tells you your variables donât match itâs placeholders
you wouldnât give everybody the chance to delete your complete database
You could do some debugging, use var_dump() or something to see what youâre actually putting into those variables.
You should look at prepared statements - that would have got around the mistake with quotes straight away, and would deal with the problem youâll get when Mr OâConnor tries to register.
Slightly off-topic: You could help yourself and those trying to help you by taking more care over formatting your code. At least use the same number of spaces or tabs on each line of code in a block and indent code within each if block.
Yes, but what is your code actually doing that leads you to believe it is not working? Does it not generate a number, or does it generate the same one all the time, or something else? Save me the job of typing in the code to see for myself.
ETA - do you actually want a random number, or do you also need the seat number to not be one that a previous row has already used up? Thatâs a different thing.
OK, on the face of it thereâs nothing wrong with the code posted. What type of column is seat_no? If itâs a numeric column, will adding the quotes around it in the query cause you a problem? If you test the query in phpmyadmin you can see whether itâs that, or just remove the quotes.