Hi all , I’m quite new to PHP and this forum I met with some problems with my programming and have no idea how to solve it will any experts mind to help?
What do you expect your code to do? What is going wrong? Are you getting errors? Help us help you, instead of asking us to do it entirely for you.
Also, I know it’s off topic from your question, but because someone will say it eventually anyway, I feel obliged to note that mysql_ functions are deprecated and should probably not be used in new code. You should use MySQLi or PDO instead. Here’s an article on switching to PDO, if you choose to do so.
Can you have a column name in MySQL that contains a space? Your query uses “Serial Number” as a column name, also you have two commas together in the query, which doesn’t seem correct either.
I would modify your table a little bit, I would have all lowercase and serial number should be either serial_number or serialNumber (it’s called camel Case).
I took it upon myself to spruce up you html form a litlte:
I like fooling around in HTML/CSS and if I get the time I’ll help you out with the php portion of the form; however, I’m sure others here will also be glad to help you out or steer you in the right direction.
Hard to tell where to look - what happens (or doesn’t happen)? Do you get error messages? How far does it get before you get a message or it stops working? What are the variable values at that point?
It is difficult to follow your code as some of it is enclosed between 3 ticks and some isn’t. However, presumably the error message gives a line number in your script where it has failed - it would be helpful if you gave the exact message you get. Also, you set the SQL code in $sql = “INSERT …” but I can’t see where you actually run the query.