I’m new to PHP and SQL, so this is something of a big bite for me…
I’ve got the following PHP code to connect to a server and select a specific Database inside the DBMS:
$server = 'localhost\SQLEXPRESS';
$link = mssql_connect($server, 'sa', 'asda');
mssql_select_db('Feedback', $link);
I have some values stored in variables like so:
$VariableA = $_POST['Field1'];
$VariableB = $_POST['Field2'];
How do I go about storing these variables into a table named ‘Data’, with the columns ‘Name’ and ‘Rating’?
There are many php frameworks that are available for you to develop your system. I have used cakephp which helps you to do database quires easily. Why not you look at such frameworks?
The syntax should be something like this:
Hope it helps you.