Jump to content

database connection


nataratafata

Recommended Posts

hey i need help im tryig to get information from my user and then process it in my database so i can use it to log them to a different web site im trying to use this method to get the information from the user but need help to get it please help me.

  //make the database connection.
        $conn = mysql_connect("localhost", "Black Jack");
        mysql_select_db("chaper7", $conn);
        
        //create a query
        
        $sql = "SELECT * FROM hero";
        $result = mysql_query($sql, $conn);

Link to comment
https://forums.phpfreaks.com/topic/237828-database-connection/
Share on other sites

 

im trying to make this code get the his name and from the user to store in he database and use to acces the website as well

 

 

<?php

               

              //make the database connection.

        $conn = mysql_connect("localhost", "Black Jack", "password");

        mysql_select_db("chaper7", $conn);

       

        //create a query

       

        $sql = "SELECT * FROM hero";

        $result = mysql_query($sql, $conn);

       

    print <<<HERE

  Intro Page To Black Jack

ID: <input type="text" name="ID" /><br />

First name: <input type="text" name="firstname" /><br />

Last name: <input type="text" name="lastname" />

User Name: <input type="text" name="Username" /><br />

Password: <input type="text" name="password" /><br />

Age: <input type="text" name="Age" />

<input type="submit" name="Play Black Jack" />

HERE;

   

        ?>

Link to comment
https://forums.phpfreaks.com/topic/237828-database-connection/#findComment-1222275
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.