HELP! Adding data on my database tables...

darylcarpo

New Member
Messages
21
Reaction score
0
Points
0
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:
 

dickey

New Member
Messages
128
Reaction score
0
Points
0
I think what you need is to issue some SQL commands to add to your database try mysql.net
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
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:

freecrm

New Member
Messages
629
Reaction score
0
Points
0
To be honest, I don't really understand the question. :)
 

darylcarpo

New Member
Messages
21
Reaction score
0
Points
0
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.
 

dickey

New Member
Messages
128
Reaction score
0
Points
0
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:
  $userid=$_POST['user_id'];
  $cssfile=$_POST['cssfile'];
  
  $query_string = "INSERT INTO table_name (userid, cssfile)
                         VALUES ($userid, $cssfile)";
  mysql_query($query_string);
 

KSclans

New Member
Messages
197
Reaction score
0
Points
0
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:
   <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)
 
Top