Jump to content


Photo

Please Help Something Simple Enough.


  • Please log in to reply
1 reply to this topic

#1 Monshery

Monshery
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 29 June 2006 - 10:03 AM

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:

$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.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 29 June 2006 - 10:34 AM

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] INTO table_name (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=some_new_value WHERE some_col=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]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users