Networking, Programming and Graphics Tutorials

UPDATE querys in PHP with MySQL APIs [1/1]

Type: Code Networking, Programming and Graphics Tutorials
UPDATE querys in PHP with MySQL APIs
Level: Beginner Networking, Programming and Graphics Tutorials 
UPDATE querys in PHP with MySQL APIs
Date: 2007-Apr-02
UPDATE querys in PHP with MySQL APIs
Visited: 1871 times
UPDATE querys in PHP with MySQL APIs
Rating: UPDATE querys in PHP with MySQL APIs
UPDATE querys in PHP with MySQL APIs
Author: Ivory Morhuld

This tutorial will show you how to use MySQL querys to database in your PHP scripts.

mysql_query(query, [link_identifier])


mysql_query() sends a query to the currently active database on the server that's associated with the specified link identifier. If link_identifier isn't specified, the last opened link is assumed. If no link is open, the function tries to establish a link as if mysql_connect() was called with no arguments, and use it.

In next examples we will teach you how to make more querys.

<?php
$query
="update table set field1='value1', field2='value2', fieldN='valueN'";
$result=mysql_query($query);
?> 
In next example we will extend the query to more complex and specific query.

This query will update date to current data, field1 will be equal to filed2 and field3 will be increased with 21 in all rows where sex equal to male, and age more that 21.

<?php
$query
="update table set date=now(), field1=field2, field3=field3+21 where sex='male' and age>='21'";
$result=mysql_query($query);
?> 
Rate this tutorial:                    
Networking, Programming and Graphics Tutorials - UPDATE querys in PHP with MySQL APIs [1/1] - Networking, Programming and Graphics Tutorials

Need a specific tutorial? Do not hesitate and submit a request!
Related Tags: mysql.querys(equals)  php mysql select querys  querys en php  querys on database  query update php mysql UPDATE  mysql update query how to update  Update data in MySQL by using Update  Ajax.Update+update mysql  mysql update inurl:mysql  mysql using UPDATE and update more an one  php do while mysql update  how to update mysql using php  using "UPDATE" mysql  MySQL using UPDATE  update mysql using php  using update in mysql  using UPDATE mysql  using update where mysql  update mysql  PHP Update MySQL