score:0
Try something like the following:
$result=mysql_query("select * from my_table");
$counter =1;
while($row = mysql_fetch_assoc($result)){
//suppose $row['id'] is your current primary key
mysql_query("update my_table set ticker_id=$counter where id=".$row['id']);
$counter++;
}
More questions
- How to insert data for one column for all the rows in single query in Mysql?
- check whether all rows in a table have unique values for a column
- SELECT rows having equal column(c1) value and adding adding another column(c2) value. Performing same for all the distinct column values for column c1
- MySQL insert into ALL rows of one column from left joined table?
- How to sum of two column into third column for all rows
- Update one column for all rows
- Insert using PreparedStatement and return values of one column for inserted rows
- Select all rows with max value on a column for all the id in array
- How to create a table where one column contains a same value for all rows with different id?(See Layout for clarity)
- show MAX column for group by - show all rows
- Trying to multiply 2 column values together for each row & print the total sum of all the rows
- Wordpress SQL Query to combine column data for all rows
- How to update value for all rows in table A should update all corresponding column values in table b and c
- the fastest way to insert multiple rows in mysql with a fixed value for a column
- How I can set a column value for all my rows that already exist in the database with some sort of mysql statement
- MySQL Query to search for all columns where 2 columns share the same 1 column
- Average all numbers in row for the past 24 hours
- MySQL get count of all rows in another table where the value equals column in current table
- SQL, how to insert all rows of a table into another one
- Calculating z values for all rows in MySql
- Workaround for insert on duplicate delete for table with all columns using foreign keys
- Select all rows per query except for one
- Insert all rows of an array into MySql table - Codeigniter-related
- INSERT ... SELECT Syntax doesn't insert all rows
- insert into for all users who are in another table
- MySQL avoiding subquery to find all rows with the same value in a column
- How to delete rows in MySQL which have same value for a column
- Select all rows which column has not already returned existing result
- MySQL insert into table if all columns entry for a row does not exists
- insert into select for multiple columns, where only one column is from another table
More questions with similar tag
- Html Output tag posted to mysql
- Dockerfile Mysql - Errors were encountered while processing
- MySQL JSON_EXTRACT subquery not working when enclosed in IFNULL
- How to change data type and remove column from table in fuelphp?
- ERROR 1288: The target table is not updatable in MySQL trigger
- mysql sum, CASE WHEN with GROUP BY
- MySQL group - fetch data across 3 tables
- How to make static nested SELECT faster
- MYSQL LEFT JOIN results with tables?
- php to mysql data retrieval
- Inserting multiple values to mysql from Javascript
- How to find the greatest difference between cells in different rows
- search for multiple keywords with php and mysql (where X like) set Limit
- New to MySQL and having issue with joining 3 tables with roll up by Month
- Count all records per day in a specific month
- Can someone please suggest a solution for this Sql error
- Text value from input field is not storing in PHP database
- converting mysql db to pg db
- ADD column if not exists in mysql
- WordPress Error Establishing Connection on Temporary URL with Vesta VPS
- MySQL plug-in error when addFunctionView: RemoteRun[master] Can't recognize function: mysql::load
- php making query from mysql database getting error like Unknown column in 'where clause'
- Get count result from mysql select and parse to TextView
- PHP is not reloaded automatically after processing
- MySQL query that returns all rows created before each month
- Representing a timetable in a database
- Finding values in column that are substrings of other values
- SQL to return first recorded date from All-time Records
- Update as NULL Mysql
- Selected Time + 1440 Minutes
Source:
stackoverflow.com