error with php code

johnob

Registered User.
Local time
Today, 21:27
Joined
Jan 12, 2014
Messages
45
Hi all,

I have uploaded a copy of my access database as .sql to my website and created a table in the mysql database.

Also done a html form of the database and a prosses.php. Evey time I run it I get the following error :

Parse error: syntax error, unexpected ':', expecting ',' or ')' in /home/u439293252/public_html/Health/process_cu.php on line 1

I cant see it. Can anyone help ?

code :

Code:
<?php $id = isset($_POST['id'] : $_POST['id'] : null; $date = isset($_POST['date'] : $_POST['date'] : null; $bp = isset($_POST['bp'] : $_POST['bp'] : null; $weight = isset($_POST['weight'] : $_POST['weight'] : null; $cholesterol = isset($_POST['cholesterol'] : $_POST['cholesterol'] : null; $hba1c% = isset($_POST['hba1c%'] : $_POST['hba1c%'] : null; $hba1cmmol = isset($_POST['hba1cmmol'] : $_POST['hba1cmmol'] : null
  
 $db = new mysqli("?????", "?????_admin", "?????", "?????_healt"); if ($db->errno) die("Error opening database: " . $db->error());
 $query = 'INSERT INTO `users` (`id`, `date`, `bp`, `weight`, `cholesterol`, `hba1c%`, `hba1cmmol`) VALUES (?, ?, ?, ?, ?, ?, ?,)'; $result = $db->prepare($query); $result->bind_param('sssssss', $id, $date, $bp, $weight, $cholesterol, $hba1c%, $hba1cmmol; $result->execute(); free($result); ?>
 CODE]
 
not sure there are any php gurus here (I'm not!) - but be patient and someone may respond. In the meantime since this seems to be more about php than access, suggest you try a php forum - if you do, include a link to your new thread on this thread so users here can see what has already been suggested elsewhere
 
John

To start with you haven't closed any of your paranthasis. It should start with something like
PHP:
$id = isset($_POST['id'] : $_POST['id']) : null; $date = isset($_POST['date'] : $_POST['date']) : null;

and carry on with the rest.

hth
 

Users who are viewing this thread

Back
Top Bottom