0
<?php

      include 'connectMySql.php';
      $emri=$_REQUEST["emri"];
      $mbiemri=$_REQUEST["mbiemri"];
      $email=$_REQUEST["email"];
      $data=$_REQUEST["data"];
      $ora=$_REQUEST["ora"];
      $nr_persona=$_REQUEST["nr_persona"];
      $query="INSERT INTO rezervim(emri,mbiemri,email,data,ora,nr_persona) VALUES(' ".$emri." ',' ".$mbiemri." ',' ".$email." ',' ".$data." ',' ".$ora." ' , '".$nr_persona."')";
      mysql_query($query) or die(mysql_error());

      mysql_close($conn);
?>

Edited by JorgeM: Move to PHP forum category

3
Contributors
3
Replies
25
Views
3 Years
Discussion Span
Last Post by diafol
-1

this is my code for booking i want to check the date i can book in,if it is available,URGENT

0

i want to check the date i can book in,if it is available

you can perform a query using a SELECT statement with a WHERE clause to see if the date is available.

Unfortuantely, there isnt really much information that you provided to be able to give you a better answer.

0

URGENT

For you, not us. Please refrain from using words such as this as they will not garner positive replies.

You don't clean your inputs and you're using REQUEST instead of GET or POST.
Also consider using mysqli or PDO as mysql is to be deprecated. In addition you don't have to concatenate simple variables within a double quoted string - you can just include them thus:

$query="INSERT INTO rezervim(emri,mbiemri,email,data,ora,nr_persona) VALUES('$emri','$mbiemri','$email','$data','$ora', '$nr_persona')";

So from the looks of it, almost every line needs changing.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.