George Pearce - iamPearce

Icon

Homepage of 18 year old internet nerd, George Pearce.

PHP Cheat Sheet

I’ve put together this ‘cheat sheet’ in the hope that it helps some people, it shows the correct syntax for various statements and I shall add to it as I have time.

PHP Statements
array ( “key” => “value”, … );
die(”messagetoshow”);
echo item;
extract ($array;)
header (”Location: url“);
if (condition) {operation]
elseif (condition) {operation}
else {operation};
session_start();
session_destroy();

PHP MySQL Functions
mysql_connect(”host”,”uname”,”password”);
mysql_select_db(”dbname“);
mysql_query(”query“);
mysql_num_rows($result);
mysql_fetch_array($result,type_of_array);

I hope this helps someone, a lot of it was learned from the dummies book and W3schools :)

-G

Category: Ramblings

Tagged: , ,

Leave a Reply

Hello

I'm George Pearce - and this is my personal blog. I'm 18, and I also write about blogging, Linux, and soon, physics. I like to take photos sometimes, and I tweet a lot @pearce.