| | |
Whats the error
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2009
Posts: 1
Reputation:
Solved Threads: 0
php Syntax (Toggle Plain Text)
<?php $con=mysql_connect("localhost","root",""); if(!$con) { die('Could not connect:'.mysql_error()); } mysql_select_db(customer1,$con) $sql1="INSERT INTO details(companyname,companyadd,comstate,telephone,fax,email,fname,lname,nic,mobile,username,password);VALUES('$_POST[coname]','$_POST[coadd]','$_POST[cost]','$_POST[tel]','$_POST[fax]','$_POST[mail]','$_POST[fname]','$_POST[lname]','$_POST[nic]','$_POST[mob]','$_POST[user]','$_POST[password]')"; if(!mysql_query($sql1,$con)) { die('Error:'.mysql_error()); } echo"1 record added"; mysql_close($con) ?>
Last edited by peter_budo; Jul 6th, 2009 at 6:54 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Aug 2008
Posts: 159
Reputation:
Solved Threads: 6
Hi..
check this two lines
check this two lines
mysql_select_db($customer1,$con) and $sql1="INSERT INTO details(companyname,companyadd,comstate,telephone,fax,email,fname,lname,nic,mobile,username,password) VALUES('$_POST[coname]','$_POST[coadd]','$_POST[cost]','$_POST[tel]','$_POST[fax]','$_POST[mail]','$_POST[fname]','$_POST[lname]','$_POST[nic]','$_POST[mob]','$_POST[user]','$_POST[password]')";
•
•
•
•
<?php
$con=mysql_connect("localhost","root","");
if(!$con)
{
die('Could not connect:'.mysql_error());
}
mysql_select_db(customer1,$con)
$sql1="INSERT INTO details(companyname,companyadd,comstate,telephone,fax,email,fname,lname,nic,mobile,username,password);VALUES('$_POST[coname]','$_POST[coadd]','$_POST[cost]','$_POST[tel]','$_POST[fax]','$_POST[mail]','$_POST[fname]','$_POST[lname]','$_POST[nic]','$_POST[mob]','$_POST[user]','$_POST[password]')";
if(!mysql_query($sql1,$con))
{
die('Error:'.mysql_error());
}
echo"1 record added";
mysql_close($con)
?>
My best wishes ... from my soul ... for everyone!
Keep Smiling....Never Depress
Keep Smiling....Never Depress
check out this code
php Syntax (Toggle Plain Text)
<?php $con=mysql_connect("localhost","root",""); if(!$con) { die('Could not connect:'.mysql_error()); } mysql_select_db(customer1,$con) $sql1="INSERT INTO details(companyname,companyadd,comstate,telephone,fax,email,fname,lname,nic,mobile,username,password) VALUES('".$_POST['conam'e]."','".$_POST['coadd']."','".$_POST['cost']"','".$_POST['tel']."','".$_POST['fax']."','".$_POST['mail']."','".$_POST['fname']."','."$_POST['lname']."','".$_POST['nic']."','".$_POST['mob']."','".$_POST['user']."','".$_POST['password']."')"; if(!mysql_query($sql1,$con)) { die('Error:'.mysql_error()); } echo"1 record added"; mysql_close($con) ?>
Failure is success if we learn from it
•
•
Join Date: Jan 2009
Posts: 11
Reputation:
Solved Threads: 1
Hi..
As in C or Perl, PHP requires instructions to be terminated with a semicolon at the end of each statement.
http://sk.php.net/manual/en/language...separation.php
and check this two lines
and
I hope it's gonna be OK.
As in C or Perl, PHP requires instructions to be terminated with a semicolon at the end of each statement.
http://sk.php.net/manual/en/language...separation.php
and check this two lines
mysql_select_db($customer1,$con) ;
and
mysql_close($con);I hope it's gonna be OK.
Last edited by peter_budo; Jul 6th, 2009 at 6:54 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Similar Threads
- C++ Program have one error :) (C++)
- error warning (PHP)
- Ned Help With Hijack This Log! (Viruses, Spyware and other Nasties)
- newcommer to c++ need help with simple program (C++)
- RIS Question (Windows NT / 2000 / XP)
- what is the problem with this app (Java)
- Packaging? (Visual Basic 4 / 5 / 6)
- Cannot figure out why I'm getting these Errors (Java)
- Cannot get method in project to work (Java)
Other Threads in the PHP Forum
- Previous Thread: cannot post an end date
- Next Thread: videos in PHP
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl data database date directory display download duplicates dynamic echo email error execution file files folder form forms function functions google href htaccess html htmlspecialchars image include insert integration ip java javascript joomla limit link links login loop mail menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php phpvotingscript problem query radio random recursion regex remote replace script search server session sessions sms soap source space speed sql structure syntax system table tutorial update upload url validation validator variable video web xml youtube





