I have the following tables. The ComponentBuild table has two columns 'comp_pn' and 'parent_pn' that are both ForeignKeys. Django is complaining Unknown column 'product_parent_pn.product_id_id. What's the correct way to model these relationship?
class Product(models.Model):
name = models.CharField(max_length=80)
def __unicod...
Hi Everyone,
I'm trying to check if a name has invalid characters, so far I've managed to get everything I need apart from checking for capitalization, I've tried using
SELECT BINARY('jiLl') REGEXP('[[:upper:]]+');
but unfortunately that also flags properly formatted names, as in (Jack), is it possible to have the regex ignore the fir...
I have a SQL script to run against a large database. I'd like to put a couple of simple queries at the start, just as a sanity check.
Is there any way to write an assertion in MySQL? Or any kind of "select ..., and if it doesn't match this value, then abort the entire script"?
...
I'm trying to install word-press on my website. i have php and its working and my mysql is working too. i need to install mysql extension for php.
This is my error im getting when trying the word-press install file.
"Your PHP installation appears to be missing the MySQL extension which is required by WordPress."
thanks
btw its window...
INSERT INTO `tims`.`pending_profile`(`id`, `nickname`, `location`, `role`, `yog`, `interests`, `favMoment`, `gainThisYr`, `futurePlans`, `bio`)
VALUES ('1', '1', '1', '1', '', '1', '1', '1', '1', '1')
ON DUPLICATE KEY UPDATE ( nickname ='1', location= '1', role= '1',yog= '1',interests= '1',favMoment= '1',gainThisYr= '1',futurePlans= '1'...
I have a field of type BIT in my MySQL table. I want to store statuses of the record using bit value, for example:
1 = status1
2 = status2
4 = status3
8 = status4
Each record can have many statuses at once. For status1 and status3 the value will be 1 + 4 = 5. I can query table for all records with status3 using:
SELECT *
FROM `tab...
Hello,
I'm starting to think about some kind of deployment script. So, sometimes we need to ALTER our tables in release etc. I need some kind of tool to compare DB structure on dev and production (or just previous version), find out difference in table's structures and generate appropriate ALTER's.
It will also be great if this tool w...
I have a SQL query:
SELECT b . * , CONCAT( GROUP_CONCAT( c.name ) ) categories, CONCAT( GROUP_CONCAT( c.id ) ) cids
FROM books b
JOIN categories_of_books cb ON b.id = cb.book_id
JOIN categories c ON c.id = cb.category_id
GROUP BY b.id
And it returns to me in categories alias all categories of books and in cids all categories ids.
A...
Hello everyone,
I am kind of stumped on the idea of echoing a list of strings from a mysql server. How would the process go? The format I want it to be is like this:
Name 1
Name 2
Name 3
Name 4
However each new name is in a new cell, and I don't know how to gather every single name from the mysql server. PHP is a very new language fo...
Heh guys,
I need help with a MySQL Query. The Output of the query should look like this
User1 User2
xxx1 xxx2
xxx3 xxx1
but not
User1 User2
xxx1 xxx2
xxx2 xxx1
and so on.
I need all "friendships" between different users. A friendship exists i.e. when
UserId 8 exists in Column User1_id
Us...
I am creating an application that has one server and multiple clients. It is a c# app that uses ADO.NET Entity Framework 4 over a MySQL database.
The clients need to get data from several database tables on the server. There are also 2 separate tables that need to be sent from the clients to the server. At some point, the client shoul...
Hi,
Just wrote a short script of copying all my tables into another local database. was quite easy but after checking it I found that the keys are gone and also the encoding for text fields are set to some default encoding.
How can I use my script and have the same keys and same encoding duplicated after copying, but not manually defin...
I’ve noticed that sometimes mysql_query() on particular query in my script executes immediately and sometimes it takes (almost exactly) 0.1 of a second. I wrote a simple script to test it:
mysql_connect('<server>','<login>','<pass>');
mysql_select_db('<db>');
print microtime(true).'<br />';
mysql_query("select * from `messages` where `...
This is a broad example of a SELECT query I use frequently on one of my sites. We are having very bad issues with slow load page times with our host, so I am trying to do everything I can to optimize every bit of code the site uses. I am no expert when it comes to MySQL, so I am hoping some of you may be of assistance. Here is the query ...
I have a multi-lingual site and we are having all of the text translated into 10 languages. We are going to have a session variable that sets a value for their country/language choice. I want to have all of our dealer contact information translated into the various languages, including country-specific alphabets like Japanese and Korea...
Can someone explain the principle behind the sql Data join. As well as provide an example and the required code?
Preferably in php.
Thanks
...
I am trying to use unicode characters (Tibetan script, but similar issues must arise for Chinese, Devanagari, etc.) in MediaWiki software to create page names. However, after a certain number of Tibetan characters the system refuses to create a page because the settings in the underlying MySQL database allow for page titles to be only 25...
Basically i need to have this query done through zend framework.
SELECT k.id AS ID ,k.name AS NAME ,k.ppu_sell AS PRICE, k.type as TYPE FROM `inventory` as k UNION
select m.id AS ID, m.name AS NAME, m.price AS PRICE, 'menu' as TYPE FROM menu as m
...
I have a very basic logon system, that authenticates users by the means of a user table in a mysql database with php.
can someone explain what the point of hashing passwords it, how to do it with php, and what is actually stored in the database.
Thanks
...
We have a legacy product that was created using Authorware. Since then the product has been through many changes, the last of which is a conversion to flash/php/mysql. We are looking to migrate some customers who are left using the Authorware product to the current version and maintain all the data. However, the data is in a v12 database...