PHP Tutorial : Get line number

As you might know, PHP Server comes with built-in / already defined constants. Today I’ve been discovering a nice one which gets the line number in a file for you. This may be very usefull in a lot of cases, like a custom error system, debugging and not only. That CONSTANT is called simply _LINE_

<?php

print…………….

Read PHP Tutorial : Get line number »

Link to us (please)

Your benefit? No need to read hundreds of pages and comments to learn a simple function. Everything is presented with an example as well as a short article.

Read Link to us (please) »

PHP Tutorial : String lenght with strlen

I’ll be directly on this short one. Shame on me that I didn’t writed about this untill now : there’s an interesting php function which you might need frequently called strlen() which translates into string lenght. I’m sure you met it already into previous tutorials on this php tutorials blog but I think I didn’t…………….

Read PHP Tutorial : String lenght with strlen »

PHP Tutorial : If condition in the short way (shorthand if)

Do you know basical php if() condition right? Yeah, right. Everybody does. To tell the truth, without a comparison operator a language would not be qualified as “programming language” (that’s why HTML is a markup language and not a programming language: it can not do comparisons and alter the program flow according to their results).
But…………….

Read PHP Tutorial : If condition in the short way (shorthand if) »

PHP Tutorial : Extract function

A shame for me but I must tell you this function called extract() simply rocks : it will extract “keys” from an array and convert them into variables, so no more needed to manually declare variables for validation purposes from forms.

<form action="" method="post">
name <input type="text" name="name"><br/>
email <input type="text" name="email"><br/>
<input type="submit" name="sb" id="sb" value="go">
</form>
<?php

if(isset($_POST['sb'])) {
extract($_POST);

if(empty($name) ||…………….

Read PHP Tutorial : Extract function »

PHP Tutorial : Mysql Dump

Did you see this expression and doubt what it means? Mysql Dumps are files in different extensions/formats like .sql, .txt etc. which are used to store databases informations, table structures, mysql tables creations, table datas/entries and more. The mysql dumps are usually used to make a backup, transfer a website database when switching hosts for…………….

Read PHP Tutorial : Mysql Dump »

PHP Tutorial : Extracting rows from mysql

Helllooooooo,
In latest two posts I have shown you how to connect to a mysql database via PHP, and in another one I teach you how to select rows from a mysql database table. In this one I will show you how to extract that rows from mysql and print them out into a page. Let’s…………….

Read PHP Tutorial : Extracting rows from mysql »

PHP Tutorial : Building a MySQL query

In a recent tutorial I was showing you how to build a connection to MySQL database via PHP. In this one I will show you how to create a query to interogate a table of the database. Look below :

<?php
$query = mysql_query(“select * from table_Name”);
?>

* – sign means all, so by using this query, you…………….

Read PHP Tutorial : Building a MySQL query »