+ Reply to Thread
Results 1 to 8 of 8

Thread: HELP! Adding data on my database tables...

  1. #1
    darylcarpo is offline x10Hosting Member darylcarpo is an unknown quantity at this point
    Join Date
    Oct 2008
    Posts
    21

    HELP! Adding data on my database tables...

    Help is there anyone know how to add data into my database table? Help here! One of my page have this kind of service; it is a registration for hosting kind of tracker for friendster. The kind of data that a user must enter and add into my database table are the following; USER ID, CSS file...:dunno:

  2. #2
    xmakina's Avatar
    xmakina is offline x10 Lieutenant xmakina is an unknown quantity at this point
    Join Date
    May 2008
    Location
    England
    Posts
    265

    Re: HELP! Adding data on my database tables...

    Something to keep in mind whilst you're still a beginner, when in doubt: w3schools.

    http://www.w3schools.com/php/php_mysql_intro.asp
    IF($this->$post.content() == "SEE SIG"){
    w3Schools and Google
    }

  3. #3
    dickey's Avatar
    dickey is offline x10 Sophmore dickey is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Singapore
    Posts
    128

    Re: HELP! Adding data on my database tables...

    I think what you need is to issue some SQL commands to add to your database try mysql.net
    Don't get me wrong as I believe if and when I help someone I also help myself whereby whatever someone learns I also learn.

    But I will also accept credits or reps if you really want to part with it.

  4. #4
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: HELP! Adding data on my database tables...

    Quote Originally Posted by dickey View Post
    I think what you need is to issue some SQL commands to add to your database try mysql.net
    nah, cpanel has several mysql tools built in.

    go into your cpanel, and setup a mysql database, then go into phpmyadmin and create a table in your new database. add the new fields into the table, and when you get that done, come back and i'll guide you further.

    ps, if userid is a name, then use varchar, if it's just numbers, use int. for the css, use either text or blob, as they allow numerous characters, although i don't know the limit off the top of my head... i want to say somewhere around 60k bytes maybe???
    Last edited by xPlozion; 11-05-2008 at 11:46 PM.

  5. #5
    freecrm's Avatar
    freecrm is offline x10 Elder freecrm is an unknown quantity at this point
    Join Date
    May 2008
    Location
    UK
    Posts
    629

    Re: HELP! Adding data on my database tables...

    To be honest, I don't really understand the question.

  6. #6
    darylcarpo is offline x10Hosting Member darylcarpo is an unknown quantity at this point
    Join Date
    Oct 2008
    Posts
    21

    Re: HELP! Adding data on my database tables...

    freecrm... what i mean is i have already my database and set- up very fine, and i need a submit form php that can send data directly into my databse. I will put yhe submit form into my website where my visitors can send the data in the field given.

  7. #7
    dickey's Avatar
    dickey is offline x10 Sophmore dickey is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Singapore
    Posts
    128

    Re: HELP! Adding data on my database tables...

    well there are two things that you can do it depends on your form. If you are using method="GET" or using method="POST"

    your action file should be in php.

    assuming you are using POST with userid as varchar(type) and cssfile as text type. And that you have successfully connected to your database.
    PHP Code:
      $userid=$_POST['user_id'];
      
    $cssfile=$_POST['cssfile'];
      
      
    $query_string "INSERT INTO table_name (userid, cssfile)
                             VALUES (
    $userid$cssfile)";
      
    mysql_query($query_string); 
    Don't get me wrong as I believe if and when I help someone I also help myself whereby whatever someone learns I also learn.

    But I will also accept credits or reps if you really want to part with it.

  8. #8
    KSclans is offline x10 Sophmore KSclans is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    198

    Re: HELP! Adding data on my database tables...

    To input data use

    db_query("INSERT INTO users (email, name, password) VALUES ('{$email}', '{$name}', '{$password}')");

    and I using variable $ so you need to set

    $email = $_POST['email']
    and for name password and other thing you need to put in to your database

    then for HTML you can do

    HTML Code:
       <form action="register.php" method="post">
        <input type="hidden" name="page_mode" value="register">
    
        <div class="left_box">Email address</div>
        <div class="right_box"><input type="text" name="email" size="30" maxlength="255" value="<?php if (isset($email)) echo $email; ?>"></div>
    
        <div class="left_box">Name</div>
        <div class="right_box"><input type="text" name="name" size="30" maxlength="255" value="<?php if (isset($name)) echo $name; ?>"></div>
    
        <div class="left_box">Password</div>
        <div class="right_box"><input type="password" name="password" size="30"></div>
    
    
    
        <div class="left_box">&nbsp;</div>
        <div class="right_box"><input type="submit" value="Register" size="30"></div>
    If you want a register system you will need
    -verify input email is a real email
    -verify if comfirm password the same as password
    -verify if username in use...

    but if you just want to input data to database then the code i put should work fine ( I don't really understand your purpose of inputting data so can't give you advise)

+ Reply to Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. HTML help...
    By anuj_web in forum Programming Help
    Replies: 5
    Last Post: 05-08-2008, 11:22 AM
  3. install drupal
    By abhi666 in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 02-18-2008, 08:05 AM
  4. PHP BB 2.0.16 Manual instalation
    By GFIV in forum Free Hosting
    Replies: 8
    Last Post: 09-14-2005, 12:40 PM
  5. Pentagon creating student database
    By Iceman in forum Off Topic
    Replies: 1
    Last Post: 06-24-2005, 01:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers