-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsaveProblem.php
28 lines (24 loc) · 902 Bytes
/
saveProblem.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require_once('DataAccess.php');
require_once('includes/functions.php');
$name=$_POST['name'];
//user info
$id=1;
$userName="me";
$email="[email protected]";
$description=$_POST['description'];
$stars=$_POST['stars'];
$latitude=$_POST['latitude'];
$longitude=$_POST['longitude'];
$now = getCurrentDateTime();
$sql = "INSERT INTO problems VALUES (null,'$name', '$id', '$userName', '$email','$description',null, 'fn','$now', 0, '$now', 'Active','$stars','$latitude','$longitude')";
$data = new DataAccess('photo');
$result = $data->executeQuery($sql);
$pid=mysql_insert_id();
if(!$result){
echo mysql_error();
return;
}
$data->dispose();
return $pid;
?>