1 Replies - 171 Views - Last Post: 11 September 2012 - 09:46 AM Rate Topic: -----

Poll: php connect with mysql database connectivity (0 member(s) have cast votes)

parse error syntax error unexpected "" on line 18 18 in php file

  1. parse error syntax error unexpected "" on line 18 in php file (0 votes [0.00%])

    Percentage of vote: 0.00%

Vote

#1 pythons123  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-September 12

php connect with mysql database connectivity

Posted 11 September 2012 - 09:44 AM

<html>
<body>
<?php
include("head.php");
$con=mysql_connect("localhost","root","");
$connection=mysql_select_db("library",$con);
$accno=$_POST['accno'];
$book=$_POST['book'];
$author=$_POST['author'];
$publication=$_POST['publication'];
$year=$_POST['year'];
$volume=$_POST['volume'];
$isbn=$_POST['isbn'];
$status=$_POST['status'];
$quantity=$_POST['quantity'];
$price=$_POST['price'];
$loc=$_POST['loc'];
$sql= "insert  into  

lib(accno,book,author,publication,year,volume,isbn,status,quantity, 

price,loc)values('".$accno.'",'".$book."','".$author."','".$publication

."','".$year."','".$volume."','".$isbn"','".$status."','".$quantity."',

'".$price"','".$loc."') ";
$res=mysql_query($sql);
mysql_close($con);
?>
</body>
</html>



Is This A Good Question/Topic? 0
  • +

Replies To: php connect with mysql database connectivity

#2 no2pencil  Icon User is offline

  • Original Digital Gansta
  • member icon

Reputation: 4503
  • View blog
  • Posts: 24,970
  • Joined: 10-May 07

Re: php connect with mysql database connectivity

Posted 11 September 2012 - 09:46 AM

Topic closed, please open a new one & post correctly.

Questions do not use polls.
Post the error in the body.
Post your question in the body.
Use code tags only around the code.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1