SamohtVII
-
Posts
55 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by SamohtVII
-
-
Ok well I made the insert.php file only have an echo in it and still didn't even give me any output just a blank page. What could be the problem?
-
Should it open up the insert.php page? I thought it would do it kinda behind the scenes. PS I am very new to php
-
I don't really want to use mysqli causeit says some kind of error in myphpadmin page about it so im ignoring it for now. How would i make it mysql? Thanks
-
Hi all,I have a php file called insert and a DB called tutorials_blog and a table called posts with a username, title and content fields. I want to make a form insert data into a table but it never inserts, doesn't give me any messages just opens up a blank page of insert.php. insert.php
<?php$link = mysql_connect('localhost', 'root', '*******');if (!$link) { die('Could not connect: ' .mysql_error());}mysql_selectdb("tutorials_blog");// Check connectionif (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); }$link="INSERT INTO posts (username, title, content)VALUES('$username','$title','$content')";$result = mysql_query($link); //order executesif($result){echo("<br>Input data is succeed");} else{echo("<br>Input data is fail");}mysqli_close($con);?>
blog.php
<form action="insert.php" method="post"> Username: <input type="text" name"username"> Title: <input type="text" name"title"> Content: <input type="text" name="content"> <input type="submit">
Insert only posting one field :S
in PHP
Posted
I have a form posting 3 things, title, user, and content and it only ends up inserting the content and date parts into the table.insert.php:
This is the only place i can see anything being wrong but i'm not sure what's the problem. maybe my form?
Please help. ty