noobkidJoin Date: 2007-09-17 Post Count: 649 |
So.. I just made a login form for my site.. But.. how do I create new rows to the table inside the database? |
|
noobkidJoin Date: 2007-09-17 Post Count: 649 |
Bump |
|
|
Open PHPMyAdmin.
Go to Google's video sharing website for more details. |
|
|
Wow ive been learning PHP and was aiming to make my own website to... Its Pretty complex... You gota have a database / server and have it refrenced and the program that i can make it on is at school and the school blocks server creations so im in a dead lock... But if i could help i would. |
|
|
Tweety, you can even do that on a home server. |
|
noobkidJoin Date: 2007-09-17 Post Count: 649 |
I know how to do it manually, I wan't to do it via PHP |
|
|
CREATE TABLE tableName
And then the values... |
|
noobkidJoin Date: 2007-09-17 Post Count: 649 |
I just wan't to add values! |
|
|
CREATE TABLE example (
id INT,
data VARCHAR(100)
); |
|
noobkidJoin Date: 2007-09-17 Post Count: 649 |
Can I put that just between
< ? php
? >? |
|
|
Like this:
< ? p h p
$dbc = mysqli_connect(connection parameters here);
$query = "Stuff I Showed Earlier";
$request = mysqli_query($dbc,$query);
? > |
|
noobkidJoin Date: 2007-09-17 Post Count: 649 |
Can I connect it separately, like this;
mysql_connect("$host", "$username", "$p45.sw0_rd") |
|
|
That's how the connection works. But, before you get too involved in PHP, ALWAYS put this in all functions starting with mysql:
mysqli
REMEMBER THE 'i', it adds extra security. |
|
noobkidJoin Date: 2007-09-17 Post Count: 649 |
What kind of extra security? |
|
vlekje513Join Date: 2010-12-28 Post Count: 9057 |
o.O I dont know where you talking about after the second chat :O |
|
|
Well, hackers could access your database and server far easier if you don't have the 'i' |
|
|
@bballer13sn mysqli is not safer than mysql, it is only a less powerfull version of mysql |
|
Text91Join Date: 2010-10-30 Post Count: 164 |
@moustachauve
MySQLi is not worse than MySQL, I don't know where you learned that.
MySQLi = MySQL Improved. |
|
|
Oh, I thing i mixed two things, i don't know what is worse and less secure than Mysql then... can't recall the right thing |
|
|
Lucky for you, I just created a PHP blog posting system. To add values to a column, while creating a new ROW, use this:
mysql_query("INSERT INTO table_name (coloumn_name,coloumn_name) VALUES ('$variable_name','$variable_name')");
This will add the variable_name's to the coorisponding coloumn_name. Please not that if you are using certain character's such as "'"'s you might need to use mysql_real_escape_string() function when imputting to your database. I would also recremend the download of MySQL Workbench (Latest Version).
if you need any more PHP/JS/JQuery/HTML/MySQL questions just ask me.
Search a program named StivaBLOG, I created a PHP/HTML/CSS/MySQL blog system JUST like it. Probably even better! |
|
|
@mousta: Incorrect. The 'i' in mysqli means 'improved.' It is both more secure and will glitch less often. |
|