first of all i need to understand what a row is in a table i know that it can have a variable name , variable value in the table could someone please explain it in simpler terms ? thanks
A "row" is the non-programmer's word for "record". Think of an Excel spreadsheet. A record (or row) in a database is a row in a spreadsheet. A field is a column in the spreadsheet. (So every record has the same fields, but not every record has the same value for the same field.) The fields have names and values, just as the columns in the spreadsheet have names (the first row usually has the name of the column) and values.
i am trying to understand this from a programmers point of view you know a table where id part which is set to auto increment i think i need to understand what a row , rows and group of rows means in a straight line means .. is it called an array of rows ? array of records ? and the primary key becoming the unique identifier for the rows right ?
What is the importance of the snippet you have provided? I was uncertain if you wanted the snippet explained or not. In your snippet the tags "<td>" is for table data. There is more info here: http://www.w3schools.com/html/html_tables.asp SO to have a table, you have to open with <table> then you need a row, so thats <tr> then the actual data goes into a tag called <td>. i would have: <table> (opening table tag) <tr> (opening table row tag <td> (table data tag) Testing (content to appear goes here) </td> (close the table data tag) <td> (table data tag Testing2 (more content to appear goes here) </td> (close the table data tag) </tr> (close the row if your finished) </table> (close the table if you have no more rows) But those tags only affect what you see on the screen. They are HTML tags, NOT php / sql tags. I am not sure if i have been of much use, if you want to, supply with a larger code segment, or the exact code your having trouble with understanding or modifying and I can see if i can help further.
It is what it says, hidden. It will not be visible on the page. This is generally used for passing values through a form that has no relevance to the user but is important for the PHP code. For example, if the form is a register form, you could output the date in a hidden textfield and pass that through with the rest of the form. This is a basic example, but in the real-world you wouldn't need to hide a registered date as you would use the <?php $date();?> function in the actual PHP file to insert a date/time.
ok .. thanks .. but since i am a noob .. i am trying to understand these concepts in terms of three things ... variable name variable value and variable name in the table i think thats how the form should really look like .. right ? i think thats what the form really want to do .. but hides it from the user ..
That's correct. Your form would look like: <form method="post" action="submitform.php"> (method is how you want to handle your form. Post will post it within the browser whereas GET will send the form via the address bar.) <input type="text" name="name" value="Please enter your name"><br /> <input type="password" name="password"> <input type="submit"> HTML: Then to pass these details to a new page (your form processing page) you would have something like: submitform.php <?php $name = $_POST['name']; $password = $_POST['password']; //Now we can do things with the passed variables such as enter into the database $con = mysql_connect("localhost","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("my_db", $con); mysql_query("INSERT INTO users (id, username, password) VALUES ('', '$name',$password)"); PHP: Now what may confuse you there is that we're entering an ID into the database, but the ID is not declared anywhere. This is because in your database, the ID field will be 'auto increment' meaning that every new row that is inserted will automatically be assigned an ID. So with the above, if this is the first row in the database, the ID will be 1, the next one being 2 etc.
its sort of nice to see how some codes work ... how html php and mysql works together ... from electrons to binary
i was following this tutorial here http://phpeasystep.com/workshopview.php?id=12 and there is not much tutorials out there where you could practise on php and mysql
There shouldn't be tutorials on PHP and MySQL, there should be (and are) tutorials on PHP, tutorials on SQL (among others) and tutorials on MySQL. They're 3 different subjects and you'll need (at least) 3 different tutorials. Playing with an interactive "PHP/MySQL tutorial" won't actually teach you anything. (And if you don't already know programming, learn that first. Learning programming languages doesn't teach you how to use them - you have to learn that before you learn individual languages like PHP and SQL.)
Furthermore: mysql_query("INSERT INTO users (username, password) VALUES ('$username','$password');"); PHP:
That depends on the name of the variable you use. The variable doesn't have to have the same name as the field. $name for the user name works just as well as $username.