When I do mysqladmin extended from the command line, my Com_* counters differ completely from doing a show status when consoled into MySQL. Why is this?
Is it possible to merge these two mysql queries into one? I want to get NOW() returned to a php variable.
mysql_query('INSERT INTO translate (IDRef, RefType, Lang, Text, LastChangeTS) VALUES ('.$id.', \''.$reftype.'\', \''.$lang.'\', \''.$text.'\', NOW()) ON DUPLICATE KEY UPDATE text = \''.$text.'\', LastChangeTS = NOW()');
mysql_query('SELECT LastChangeTS FROM translate WHERE IDRef = '.$id.' AND RefType = \''.$reftype.'\' AND Lang = \''.$lang.'\'');
I'm changing my dataset in my program. And when my job was finished, I'm connecting to mysql database. I don't want to do this job again, how can I send changings to database like this
mydatadapter.Update(dataset, " table");
I found this code, but I can't run it :S
Why Nibernate HQL can not handle the following query:
from Deal D where (D.ApprovalDate + INTERVAL 1 Year) < current_timestamp() < (D.RenewalDate + INTERVAL -1 Year)
knowing that INTERVAL and YEAR are keywords in MySQL, so this is kind of mixing Sql within Hql (unless Hql can handle date functions like so and I don't know) . The dialect is MySQLDialect
Its perfectly valid to execute this query
SELECT '2005-01-01' + INTERVAL 1 Year;
Is there anyway invoke a PHP page / function when a record being inserted in to the mysql db table. We dont have control over the record insertion procedure.Is there some thing called trigger which can call a PHP script back ?
Finding it a little bit tedious migrating to the new Mysql Workbench (5.2.22) even though it has many more features than the older GUI tools. Right now I'm confused why I can't find an SQL reference when I open the Doc Library. Is there a way to access this info within the workbench, I'd prefer not to have to open a browser to access reference info on the web.
I have a class variable called attributes which lists the instance variables I want to update in a database:
attributes = ['id', 'first_name', 'last_name', 'name', 'name_url',
'email', 'password', 'password_salt', 'picture_id']
Each of the class attributes are updated upon instantiation.
I would like to loop through each of the attributes and build a MySQL update query in the form of:
UPDATE members SET id = self._id, first_name = self._first name ...
Thanks.
i wonder if there is gui tools for creating a graphical map for the relationship between models/objects (doctrine) or tables (mysql)?
it would be better than draw it manually.
i´ve already have the models/objects and tables created.
Is it possible to import the attributes of one table, then I put it into another table using a query in mysql?
For example I have table1 with attributes lname, fname, mname
And I want to put those attributes into table2.
Is there any query that could do that? I'm imagining that the table2 has one attribute that could later be dropped so that it will be the same as table1.
I'm having a table, where one ID, can have multiple statuses
| client_id | status_id |
| 1 | 2 |
| 1 | 3 |
| 1 | 5 |
| 2 | 2 |
| 2 | 3 |
| 2 | 6 |
The problem is, to select only those client_id's if they have all the statuses i.e. 2,3,5 (status_id = 2 AND status_id = 3 AND status_id = 5) but mysql doesn't allow that directly.
Hi I have a field in mySql table called jobnumber which auto increments with each new entry. What I want to do is when a user views my form, get the value of the next 'jobnumber' . But I want to do this before any entry is made to the table. IE so when a user looks at a form it will display something like 'this is job number 6954'
I have tried $rr = mysql_insert_id() but this only work after I have made an entry
Can anyone help please
thanks
If I have a Parent and Child table in MySQL related by a foreign key, is it possible using a SQL statement to move certain rows from Parent and the related rows from Child into archive tables (e.g. Parent_Archive and Child_Archive) in an atomic manner?
I have a MySQL DB in which I store data about each user.
I would like to add a list of friends for each user. Should I create a table of friends for each user in the DB or is there a better way?
i have a mySQL table which the data in one of its columns is in a language other than English.(Persian)
when i input data in the table , it is shown properly but when i want to show the data in a php file it displays like this:????
well,what should i do in order to show the data in its correct form?
How do I instruct Nant to tell MySql to run ddl scripts from a particular location and then run other scripts as instructed?
Google let me to many sites which unfortunately do not work...
i am using mysql database
i have a table called sales
its primary key is sales_id
-------------------------------------
sales_id | invoice_id |
-------------------------------------
1 | 147
2 | 148
3 | 150
for sales-id 3 the invoice is supposed to be 149. i want to know which numbers are missing from invoice_id (i start invoice_id is 147 and end invoice_id is 4497). The invoice_id had no relation with sales_id
is it possible to know which numbers are missing from invoice_id, using some queries??
I have a .sql file from a MySQL dump containing tables definitions and the data to be inserted in this tables. How can I convert this database represented in the dump file into a MS SQL server database?
I want to add 100 entry to users table numbers field, random characters length is 10, all entry should be unique as well. How can i achieve this using MYSQL query code ?
Or do i need to use PHP ?
Help me with code snippets please. Thanks.
i want to create a table :
products
which looks like
(these are columns name)
Id Name Category-id Description
now Category-id column gets the values from another table
category
which looks like
Id Name Description
now category.Id is used in products.Category-id
how to do this in mySQL
Hello,
I backed up my db with mysqldump from phpMyAdmin. Using MySQL 5.0.22. Made no changes to database file. Import fails. Found many instances of extra spaces using notepad, but now cannot find any other such extraneous spaces. Error is 1064.
Any suggestions on how to import file properly?
Thanks.
hey guys
i need to add a special text to all rows in my mysql table ,
how to add some text to the end of all rows' content in a table just for one field
i used this code :
UPDATE `blogs` SET `title`= `title`+ 'mytext';
but didnt work for me
Hi,
I'm trying to make a Tag cloud for every user in own page, I'm using PHP5 and Mysql, My table named "tags" and I want to make a array but in short way. The table like below,
The array can be like
for user1 array={[car,1],[cat,null],[pen,1],[dvd,1],[cd,null]}
Username totaltag tag1 tag2 tag3 tag4 tag5
admin 5 car cat pen dvd cd
user1 1 1 1
user2 1 2 12 1
user3 3 2 10 1
Hello,
I am trying to insert data into a mysql table from a csv file. I am using the infile sql command, but I am having trouble because the first column of the table is an id that is set as an auto increment field. what do I have to set my first column value to in order to get this to work, or can I do it at all?
Thanks
I have this mysql query:
SELECT *
FROM Customer c
JOIN eHRDemographic ehD ON ehD.CxID = c.CustomerID
JOIN CustPrimaryWeight cpW ON cpW.CxID = c.CustomerID
WHERE c.CustomerID =22703
GROUP BY c.CustomerID
ORDER BY cpW.CustPrimaryWeightID DESC
This doesn't really work correctly as the CustPrimaryWeight table has multiple enteries and it's simply joining the first entry and not the more recent one as the ORDER statement doesn't seem to do anything.
Any ideas?