can you please! this is the error..
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in C:\hshome\scaseduph\scas.edu.ph\form2.php on line 3
Could not connect: Can't connect to MySQL server on 'localhost' (10061)
3 Replies - 999 Views - Last Post: 04 May 2011 - 08:45 PM
Replies To: Can't connect to MySQL server on 'localhost' (10061)
#2
Re: Can't connect to MySQL server on 'localhost' (10061)
Posted 04 May 2011 - 08:26 PM
Which server are you using? (WAMP, XAMPP...)
#3
Re: Can't connect to MySQL server on 'localhost' (10061)
Posted 04 May 2011 - 08:35 PM
#4
Re: Can't connect to MySQL server on 'localhost' (10061)
Posted 04 May 2011 - 08:45 PM
polysean, on 04 May 2011 - 08:35 PM, said:
*** this is my codes. what user name can i insert at the connection? is it the one that i created at the control panel?
<?php
if (isset($_POST["submit"])){
$con = mysql_connect("localhost","name","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("scasedu_registration", $con);
$query="insert into students_information (id,Last Name) values('"
.$_POST["id"].
"','"
.$_POST["lastname"].
"')";
mysql_query($query);
mysql_close($con);
$to = "plamo@scas.edu.ph";
$subject = "test subject";
$body = "Register".$_POST["lastName"];
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
echo "save";
}
?>
<body>
<form id="form1" name="form1" method="post">
<p></p>
<p align="center"> <span class="style2">Sumulong College of Arts and Sciences</span><br>
SCAS Bldg., M.L. Quezon Ext. Brgy. Dalig, Antipolo City</p>
<p align="center">APPLICATION FORM</p>
<p> </p>
<fieldset>
<legend>Basic Information</legend>
<p>
<label>id:
<input name="id" type="text" size="50" maxlength="20" />
</label>
</p>
<p>
<label>last name:
<input name="lastname" type="text" size="50" maxlength="20" />
</label>
</p>
<p>
<label>
<input type="submit" name="submit" id="submit" value="Submit" />
</label>
<label>
<input type="reset" name="reset" id="reset" value="Reset" />
</label>
</p>
MOD EDIT: Added code tags. When posting code...USE CODE TAGS!!!
This post has been edited by JackOfAllTrades: 05 May 2011 - 02:46 AM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|