Jump to content

hi there


FURQAN

Recommended Posts

hi there

my name is furqan ahmed

i have a problem in my php code "i actually wanna make my costumise database means i am getting a name with a text box and wanna make a table in the database of the name which the user have entered in the text box" following is the code

 

<html>
<head><title>page link</title></head>
<body>


<form method="post">
<input type="text" name="rollnumber" >
<input type="submit" value="done" name="setup">
</form>
<?php
$conn=mysql_connect('localhost','root','') or die('cannot connect');
mysql_select_db('temp',$conn) or die('database is down');
echo'go a head';
echo'enter your epno. or roll number to setup your properties in the database';
if(isset($_POST['setup'])) {
$table=$_POST['rollnumber'];
echo $table;
$query="CREATE TABLE FURQAN
(
id INT(25), 
answer VARCHAR(15) )";
$re=mysql_query($query,$conn) or die('furqan ahmed go a head');

}
?>
<a href="pagination1.php?go=0">start</a>;

</body>
</html>

can any body help me please

Link to comment
https://forums.phpfreaks.com/topic/200193-hi-there/
Share on other sites

it is indeed possible to create tables on the fly, However, I really have to ask why?

 

how exactly is it "not working"? Is it are you getting an error? is the MYSQL failing (and thus showing the die() text, which is "go ahead ahmed" or something like that)

 

If its the latter, change your die text with mysql_error() so you can see exactly whats going on

 

 

Link to comment
https://forums.phpfreaks.com/topic/200193-hi-there/#findComment-1051172
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.