Monshery Posted June 29, 2006 Share Posted June 29, 2006 First:1. what is the query i uses to insert into into table - just dont know the format of how to do it for eg:[code]$var = mysql_query("SELECT * FROM table WHERE blabla = something", $mysqlconnection);[/code]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 --[code]("SELECT * FROM table WHERE ID = /* how do i check the max number on the field*/',$mysqlconnection);[/code]Thnx in advanced to helpers help is realy appricated. Link to comment https://forums.phpfreaks.com/topic/13187-please-help-something-simple-enough/ Share on other sites More sharing options...
wildteen88 Posted June 29, 2006 Share Posted June 29, 2006 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] Link to comment https://forums.phpfreaks.com/topic/13187-please-help-something-simple-enough/#findComment-50760 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.