i was trying to do a simple college project .. with the help of html php and mysql i was wondering which are all the parts of a php program in that line echo $row ['firstname'] i have a confusion about which belongs to what .. especially when dealing with html php and mysql
echo (display to the web page) $row (coming from a data base row) ['firstname'] (the data coming from database under First Names Its a handler dealing with data that has been called above it in SQL and the PHPscirpt is calling fields and data from the SQL database, in that case you're showing. Its pulling the first name. You have all the rest of those missing/not posted. The code you posted is PHP. The code above it (not showing) would be SQL with something like SELECT * FROM tablename .Once SQL pulls all the data , it has to be put into usable form for PHP. That's where you see PHP script dividing the data with $row ['firstname'] and its echoing (displaying it to the page) you can further turn this into usable variable with $firstname = $row['firstname']; and so on..
i am using html php and mysql echo is part of php $row is part of php ['fieldname'] or ['labelname'] is part of an html form or mysql table $ does that dollar sign standing alone means anything ? i thought it was used to represent a variable name ?
yes, the $row is a PHP var. Read the PHP tutorials or start with a book gether. In 6 months you won't have any questions about those simple things.
"$row" as a whole is a php variable ? i have seen variable names starting like $somevariablename so is it ok to call $row ..... $somevariablename ?
Well, $blabla = Would be you making your own Variable, and this can be used with the standard PHP Variables (Ones which come by default) such as $row['']; For Example, $Customer_First_Name = $row['CFirstname']; echo $Customer_First_Name; PHP: So $row['CFirstname']; Finds the row inside your database called CFirstname and places the details of that into the custom made Variable. I then simply echo'd the variable
ok thanks.. its a default part of that php programming language... "echo" too is a default part of the programing language ?
Gether, PHP,MySql, Apache book is for you. It's probably at Amazon etc. If you need to, go sell a couple of my programs and I'll buy you one. Then you pay me back in 2 years when you sell your own programs OK?
nice.. so .. yea.. staying with the programming defaults.. learned a few important things online.. there was almost no education offline.. lol
lol .. this may sound really stupid.. but let me try to remove that $sign from everywhere and see what that code does....