Search the Community
Showing results for tags 'create'.
-
Hii.. I had made a table in the database. And also had printed out the data... There are 20 episodes in a movie... And I had fetch and printed all the 20 episodes. Now I want to make those 20 lines clickable link and when user clicks on that link than it should perform some operation like in the thenewboston.org website when you click on Video & Tutorials Tab from the nav bar than it opens up all the topics. and when we click on for e.g. PHP VIDEOS than it takes to the particular page and than in the PHP Tutorials it shows a list of 200 videos and than when you click on any of the page than it fetch the data from database and than print the related data. So how should I make the dynamic links like http://thenewboston.org/watch.php?cat=11&number=21 ... And how should I write the operation in my php page which than performs the query and display it on that page... Any link referring to tutorial will work... Any Help would be appreciated.
- 6 replies
-
- sql
- dyanmic link
-
(and 3 more)
Tagged with:
-
I am trying to create MySQL database using PHP. Here is my code. db-config.php <html> <head> <title> Database Configuration </title> </head> <body> <?php $host = "localhost"; $user = "root"; $pass = "123456789"; $database = "hello"; $mysql = new mysqli($host,$user,$pass); if($mysql->connect_error) { die ("Could not connect to database"); } ?> createdb.php <html> <head> <title> Create tables </title> </head> <body> <?php include("\db-config.php"); if(!$a = ($mysql->query("CREATE DATABASE $database")))die("Could not create database"); echo "Successfully created database"; $table = "user"; $td = "userid MEDIUMINT(10) DEFAULT '0' NOT NULL AUTO_INCREMENT,"; $td .= "username VARCHAR(20) BINARY NOT NULL,"; $td .= "password VARCHAR(20) BINARY NOT NULL,"; $td .= "name VARCHAR(20) BINARY NOT NULL"; $test = $mysql->query("SELECT DATABASE $database"); if(!(mysqli_select_db($mysql,$database)))die("Could not connect to database"); if(!(mysqli_query("CREATE TABLE $table ($td)")))die("Could not create tables"); echo "Successfully created tables"; ?> </body> </html> It always results in die message. Please help.
-
Hey All, I always use Blue Host for my websites, but they don't let you use the CREATE TABLE MYSQL command. Does anyone know of any hosting services, reliable ones, that allow you to use this command?? And on a side note, best free web hosting?? Thanks in advance,