Jump to content

Please Help Something Simple Enough.


Monshery

Recommended Posts

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
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.