| | |
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: 149
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 |
ajax apache api array basic beginner binary body broken cakephp checkbox class cms code cookies cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert interactive ip javascript job joomla js limit link login mail mediawiki menu mlm mobile msqli_multi_query multiple mycodeisbad mysql navigation oop outofmemmory paging parse paypal pdf php procedure query radio ram random recursion regex remote script search server sessions sms source space sql stored subdomain syntax system table tutorial unicode update upload url validator variable video web webapplications websitecontactform xml youtube





