Quantcast
Channel: WJunction - Webmaster Forum - QuickRDP.com- Upto 60% on rdp plans for ...
Viewing all articles
Browse latest Browse all 15793

Fixing PHP snippet code

$
0
0
Hello,

I have a snippet of code that supposed to add 5 values to MySQL database, the problem is that it doesn't add the values to the correspond MySQL database.

PHP Code:

<?php
$host
="XXXXXX"
$username="XXXXX";
$password="XXXXXX"
$db_name="XXXXXX"

$con=mysql_connect($host$username$password)or die("cannot connect"); 

mysql_select_db($db_name)or die("cannot select DB");

$tutorialID $_GET["tutorialID"];
$email$_GET["email"];
$note$_GET["note"];
$title$_GET["title"];
$date$_GET["date"];


$sql "INSERT INTO `notes`(`tutorialID `, `email`, `note`, `title`, `date`) VALUES ('".$_GET['tutorialID']."','".$_GET['email']."','".$_GET['note']."','".$_GET['title']."','".$_GET['date']."')";

$result mysql_query($sql);
if (!
$result) {
    
$json = array("result"=>"no");
}else
    
$json = array("result"=>"ok");

header('Content-Type: application/json');
echo 
json_encode($json);
?>

The url of that php code is:
"notes" MySQL table:


What's the problem?

Thanks in advance!

Viewing all articles
Browse latest Browse all 15793

Trending Articles