• RIYAN MEHMOOD
  • Junior Member
  • Posts 9
  • Reputation 0
  • Member Since
  • Last Active
All Posts Topics Started Likes
Database Selection Error-
Dear Sir,
Assalam-O-Alaikum,
 
My name is Riyan Mehmood- And I am working on PHP My-SQL, 
I have following problem occuring from many days and I have no solution for that, Kindly tell me the method for database selection-
 
 
My Coding is here:-
 
<?php
 
$con=mysqli_connect("localhost","root","") or die("connection fail");
echo "Your Connection Established";
 
$con =mysqli_connect('localhost','root','password','school');
echo "database connection done";
 
?>


Error screen.png  my database.png
0 0
Problem About Database Selection & Inserting Data-
This Is The Coding- But Database Not Selected & Record Also Not Inserted-

***********************************************************

<html>
<head>
<title>Student's Data</title>
</head>
<body>

<form action="students.php" method="POST">
<table width="500" border="5" align="center">

<tr>
<td align="center" colspan="5" bgcolor="silver">
<h1>Student's Registration</h1></td>
</tr>


<tr>
<td align="right">Student Name:</td>
<td><input type="text" name="name"></td>
</tr>

<tr>
<td align="right">School Name:</td>
<td><input type="text" name="school"></td>
</tr>

<tr>
<td align="right">Roll No:</td>
<td><input type="text" name="roll"></td>
</tr>

<tr>
<td align="right">Result:</td>
<td><input type="text" name="result"></td>
</tr>

<tr>
<td colspan="5" align="center">
<input type="submit" name="submit" value="Submit Now"></td>
</tr>

</table>
</form>
</body>
</html>

<?php
$server="localhost";
$user="root";
$pass="";

mysqli_connect($server,$user,$pass);
//echo "Your Connection Established";

if(isset($_POST['submit'])){

$name=$_POST['name'];

$school=$_POST['school'];

$roll=$_POST['roll'];

$result=$_POST['result'];

$query="insert into students (student_name,school_name,roll_no,result)
values ('$name','$school','$roll','$result')";

if(mysqli_query($query)){
echo "<h1>Your Data Inserted</h1>";
}
}
?>


Kindly Solve This Problem-
Thank You Very Much Sir.
0 0
About Database College-
ASSALAM-O-ALAIKUM TO ALL,

Dear Sir, I have a problem during creating "DATABASE COLLEGE" Shown in "PHP ADVANCE LECTURE-6"-

I am sending you the screenshot to show that what type of error occurs-
Kindly guide me-

THANK YOU VERY MUCH SIR.




Database college.png 
0 0
About XAMPP-
DEAR SIR KAMRAN ASSALAM-O-AlAIKUM

Sir me ne XAMPP version 1.5.3 download kia he, lekin wo "SUCCESSFULLY INSTALLED" ka page show nahi karraha he.
Aap ka XAMPP version 1.5.3 he ya 1.5.3a-
Kindly tell me-
kionke dosre versions per mujhse kaam ho nahi raha he,
And I am new user of PHP

THANK YOU VERY MUCH SIR.
0 0
About Database College-
DEAR SIR KAMRAN ASSALAM-O-ALAIKUM-
 
Sir aap XAMPP ka konsa version use karrahe hen kionke me jab aapke tutorials ke sath perform karta hon to kabhi kabhi error aata he, jabke aapke codes me error nahi hota, jaldi execute hojate hen, Me database nahi bana paraha hon, tables ki Rows show nahi ho rahi hen?
 
AND
While making Database of a college I have some problem-
 
<?php
$con=mysqli_connect("localhost","root","") or die("connection failed");
echo "connection established";
 
$con=mysqli_select_db("college","table") or die("database error");
echo "Database selection done";
?>
 
 
Error message-
 
connection established
Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in D:\xampp\htdocs\database.php on line 5
database error
0 0
About Database College-
Dear Sir Assalam-o-alaikum-
And **********HAPPY EID MUBAARAK**********
From Me
To You and all the Members of "URDU IT ACADEMY"-

Now my problem is that-

Me ne College ka Database banaya he lekin jab table bangaya to save pe click karne ke bad ye error aaya he- jo click hone per fori remove hojata he- Me ne 5 din tak try kia tha lekin database nahi ban saka- bohat koshsish ke bawajood error nahi remove horaha he-

Dear sir kindly guide me about it-

--------------------------------------------------------------------------------------------------------------
#1089 - Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys-

-----------------------------------------------------------------------------------------------------------------
0 0
Php Execution Error please help
Dear sir,
I am studying your Advance PHP Lectures # 6 "INTRODUCTION TO DATABASE", I got an error on chrome browser.

Fatal error
: Uncaught Error: Call to undefined function mysql_connect() in D:\xampp\htdocs\database.php:2 Stack trace: #0 {main} thrown in D:\xampp\htdocs\database.php on line 2.


CODING:-


<?php
$con=mysql_connect("localhost","root","") or die("connection fail");
echo "connection established";
?>


Please guide me what's a mistake i made in this Php code please solve it otherwise, Because code is not executed 5 times and still it is not executing, I cant move forward to the next lecture without understanding it.
0 0
About database-
ASSALAM-O-ALAIKUM SIR

Sir DataBase ka bata den, coding correct he, lekin phir bhi connect nahi horaha he, Fatal And Parse errors bar bar show horahe hen.
Kindly guide me- is se pehle itna error kabhi nahi aaya he XAMPP me.
0 0
ABOUT VALIDATION FORM-
DEAR SIR-
ASSALAM-O-ALAIKUM-

MY NAME IS RIYAN MEHMOOD-

"Form validation" me "POST" METHOD use karne ke baad bhi "password" "numbers ya alphabet" dono soorton me show horaha he,
hide nahi horaha,
kindly is hawale se solution bataden, kiyon ke mene saara code aapke lecture se dekha he,
lekin yahan per musalsal password "POST" method ke bawajood bhi show horaha he,
sir kindly guide me about that,
me PHP PROGRAMMING me naya hoon,
lekin aapke lectures "LEARNING CONCEPT" ke hawale se bohat behtareen hen.
0 0
count post selected

Add a Website Forum to your website.