mysql

In Django, why does this error say that my column can't be null?

picture_url = models.CharField(max_length=2000) ...

Strange SQL problem selecting multiple values for same column

Hello there, Been at this for a few hours now and I can't make any sense of it. I've used this way of selecting multiple values for same column a few times, but there is something weird with this one. SELECT * FROM employee as s INNER JOIN works AS w1 ON w1.name = s.name INNER JOIN employee AS w2 ON w2.name = s.name INNER JOIN employee...

Table relationship for subtypes

I have a parent table called 'Website' which holds records about websites. I have a child table called 'SupportSystem' which holds records about different types of support systems such as email, phone, ticketing, live chat etc. There is an intermediate table 'Website_SupportSystem' which joins these tables in a many-many relationship. ...

PHP SESSION: SESSION Variables Automatically Reset after Unserialize()

I am testing codes from build internet which is a tutorial of OOP. I got a error message: unserialize() expects parameter 1 to be string, object given in includes/global.inc.php on line 20 Here is the code of serialize(): $_SESSION['user'] = serialize(new User(mysql_fetch_assoc($result))); And here is the code of unserialize...

How to pass id value with jquery to PHP?

Hello, I am trying to pass an id value to a php script with jquery. So, I was trying to create a link: <a href="#" id="superman">Superman</a> and when this link is clicked, I would like jquery to grab the id value and place it in the php script or php grabs the id? im not sure the best way. I want the id value so it can be placed in...

SQL Query to only exclude data of last 24 hours?

I have the following data: Table Name: NODE NID | Name | Date 001 | One | 1252587739 Date is a unix timestamp. I need a query, whereby I can select only the nodes who's "Date" is older than 24 hours. Something like this: SELECT * FROM NODE WHERE Date < NOW() - SOMETHING Anybody know how to do this? Does the NOW() - SOMETHING part...

SQL Query Returning Duplicate Results

Hi, I've been working out this query now for a while and I thought I had it where I wanted it, but apparently not. There are two records in the database (orders). The query should return two different rows, but instead returns two rows that have exactly the same values. I think it may be something to do with the GROUP BY or derived tab...

Getting a PHP PDO connection from a mysql_connect()?

I have a legacy PHP/MySQL app that calls mysql_connect(). Tons of existing downstream code makes mysql_query() calls, either directly or through wrappers, using this connection. For new code that I develop on the app, I would like to start using PDO. If I make a PDO connection using the same host/user/pass/dbname credentials, might I b...

MySQL Recover Deleted Database

Accidently dropped my database from Mysql.Any way to recover that table. Anybody can help me please........... ...

php session vs mysql speed

i am working a on a permission system. In each page it will need to check whether if the user has the permission to do so. I have two choices, store the data in a session variable (which is only updated during login) or query the database for the information every time. Which is faster? I realized that if the permission changes, I will...

datasets: xml or mysql faster ?

hi, I'm using the stackoverflow dataset, I would like to know if I should convert the dataset from xml to mysql to improve the retrieval performances and work more efficiently. If it is better to convert to mysql, can you suggest conversion tools (I'm on a mac) thanks ...

How to automatically parse an RSS feed for storage in MySQL database?

I need to somehow automatically update/parse a couple of RSS feeds and place them into a MySQL database almost as soon as the feed is updated, or as close as possible. However, I can't work out the best way to do this automatically - I've found tutorials for doing it when a user runs a script - but in this case it all needs to be done in...

mysql_query preserve the data type created in the table on return?

Hi I have a table in mysql: CREATE TABLE user (id INT, name VARCHAR(250)); I query the table: $result = mysql_query("SELECT id,name FROM user"); I gather the results: while($row = mysql_fetch_assoc($result) $rv[] = $row; And I return the data: echo json_encode($rv); The problem is that the id returns as string and not int, ev...

How to print webpages in vb.net

I currently have this code use for printing a table in mysql database , but there's a problem, the print button is also shown when I print the table. Do you know of any alternative or even a vb.net code that will print what is currently on the web browser in vb.net(the one being dragged from the toolbox used to view web pages or php file...

How to put password in mysql database that you export using phpmyadmin

How do I do that? Is it possible? If it's not possible in phpmyadmin then can you tell me some alternative to achieve the same thing (putting a password to the mysql database that is being exported for backup)? ...

MySQL field type to count bytes filesize

Morning, I'm storing documents informations (Word, excel, ...) in a MySQL database. I have a column "size" where i store the filesize in bytes like 582656, 136260, 383266... But when i order by size, results are a little bit disorder. What type of mysql field should i use ? I've tried VARCHAR and INT, same result. Regards, Emmanuel ...

Simplify a MySQL query

Hi, I have below a working query that needs to be simplified. The reason is that I need to expand it a lot to cover the real application. For each condition (Pos=xxx AND Indata=yyy) the current query doubles in size, and I have a lot of conditions. Also the ON clause will contain many more conditions than in the example.... The real a...

how to automatically export mysql database in phpmyadmin

is it possible to automatically export mysql database in phpmyadmin ...

setting global sql_mode in mysql

I am trying to set sql_mode in mysql but it throws an error. Command: set global sql_mode='NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLE','NO_AUTO_CREATE_USER','NO_ENGINE_SUBSTITUTION' Is this not the proper way to set multiple modes? What are the advantages of setting session and global modes? which is preffered? I have different user...

Problem with MYSQL database, values are not inserted

Hi, I am trying to insert values in database and values are not being inserted, here is the code i have: $user_name = "username"; $password = "password"; $database = "database"; $server = "localhost"; $db_handle = mysql_connect($server, $user_name, $password); $db_found = mysql_select_db($database, $db_handle); ...