Jump to content


This topic is now archived and is closed to further replies.


Please Help Something Simple Enough.

Recommended Posts

1. what is the query i uses to insert into into table - just dont know the format of how to do it for eg:

$var = mysql_query("SELECT * FROM table WHERE blabla = something", $mysqlconnection);

2. what is the query i uses to update table - what is the format on how to do it
3. in SELECT query how do i select the biggest number in the field i mean --
("SELECT * FROM table WHERE ID = /* how do i check the max number on the field*/',$mysqlconnection);

Thnx in advanced to helpers help is realy appricated.

Share this post

Link to post
Share on other sites
To insert data inot the database use the followng query:
[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']INSERT[/span] [color=green]INTO[/color] [color=orange]table_name[/color] (column1, column2, ...) VALUES (column1_value, column2_value, ...) [!--sql2--][/div][!--sql3--]

For updating a database use the following query:
[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']UPDATE[/span] table_name SET column_name[color=orange]=[/color]some_new_value [color=green]WHERE[/color] some_col[color=orange]=[/color]some_value [!--sql2--][/div][!--sql3--]

For your third question, you want to look into the MAX mysql function.

Also here are a few turtorials on SQL Syntax:
[a href=\"http://www.php-mysql-tutorial.com/\" target=\"_blank\"]http://www.php-mysql-tutorial.com/[/a]
[a href=\"http://www.w3schools.com/sql/sql_intro.asp\" target=\"_blank\"]http://www.w3schools.com/sql/sql_intro.asp[/a]
[a href=\"http://www.tizag.com/mysqlTutorial/\" target=\"_blank\"]http://www.tizag.com/mysqlTutorial/[/a]

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.