Hello,
I have a strange bug. I launch a PHP Unit test Suite. At the beginning, it executes a big query to initialize the database.
If I put a breakpoint just after the execution of the sql, there is no problem and my tests pass.
If I don't put any break point, they don't pass and say that the tables don't exist!
It works as if the s...
I have a table:
+--------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------+------------------+------+-----+---------+----------------+
| idurl | int(11) | NO | PRI | NULL | auto_increment |
| idsite | int(10) unsigned | NO | MUL |...
What is the best way to create an Archive of image documents in the database ?
Given we have about 2-10 million records and each record includes 2-4 images and about 20 text fields , what is the best way for create this archive so that we have good speed and high security for data?
Also, what database is good for this project?
...
I read about an inheritance feature in PostgreSQL that seemed pretty neat. Unfortunately I am forced to use MySQL. How would you do something similar in a clean way?
Say you for example had the two following classes that you want to work with:
User
˪ Id
˪ Name
˪ Password
Employee : User
˪ Pay
How would you store those in a MySQL...
I am quite certain we cannot use the LIMIT clause for what I want to do - so wanted to find if there are any other ways we can accomplish this.
I have a table which captures which user visited which store. Every time a user visits a store, a row is inserted into this table.
Some of the fields are
shopping_id (primary key)
store_id
us...
All,
I have a PHP Web application built using Zend Framework and MVC with MySQL database. I plan to implement Context-Sensitive Help for the application.. I did my research but I didn't find any good pointers on how to achieve this.
Can someone point me to a book or a nice reference with example that does this? I see this implemented ...
Hi everyone,
We are currently planning the database structure of a quite complex e-commerce web app that has flexibility as its main cornerstone.
Our app features a large amount of data (products) and we have run into a slight headache trying to keep performance high without compromizing normalization rules in the database, or leaving ...
Does the inserts are finished with the transaction commit? Or they can be finished later?
...
I followed the instructions here: http://crazytoon.com/2007/07/23/mysql-changing-runtime-variables-with-out-restarting-mysql-server/ but that seems to only set the threshold.
Do I need to do anything else like set the filepath?
According to MySQL's docs
If no file_name value is given for --log-slow-queries, the default name is
host_...
I have a MySQL field which stores an array with 3 values:
array(item1=>1123, item2=>5454, item3=>23432)
How can I query the database with PHP so that I get only distinct values of item2 and then arrange those results by the values of item3?
...
If a model changes an attribute locally, then changes it back, ActiveRecord doesn't send the change to the DB. This is great for performance, but if something else changes the database, and I want to revert it to the original value, the change doesn't take:
model = Model.find(1)
model.update_attribute(:a, 1) # start it off at 1
# some ...
I'm working with a CMS system where I cannot control database column names. And I've got two related tables:
Table: content
+------------+----------+----------+----------+----------+
| content_id | column_1 | column_2 | column_3 | column_4 |
+------------+----------+----------+----------+----------+
| 1 | stuff | junk |...
Using the above technologies, I want to create a PDF, store it in my db, and email it. All with the click of one button.
I also want to call it up and have it be able to display with a hyperlink.
I am very new to FPDF. Therefore, I am trying to start off very slowly.
I began with this link stackoverflow Q
I put both parts of his c...
So I have 3 DB tables that are all identical in every way (data is different) except the name of the table. I did this so I could use one piece of code with a switch like so:
function disp_bestof($atts) {
extract(shortcode_atts(array(
'topic' => ''
), $atts));
$connect = mysql_connect("localhost","foo","bar");
if (!$connect) { ...
How should my Mysql table data look like for a single checkbox that checks and see if the user has said yes if its clicked or no if its not?
Here is the checkbox.
<input type="checkbox" name="yes" id="yes" value="yes" />
I was wondering how would I add it to the following table.
CREATE TABLE IF NOT EXISTS `vote` (
`counter` int(8) N...
I'd like to paginate through a randomly sorted list of ActiveRecord models (rows from MySQL database).
However, this randomization needs to persist on a per-session basis, so that other people that visit the website also receive a random, paginate-able list of records.
Let's say there are enough entities (tens of thousands) that storin...
I have a table with at least a couple million rows and a schema of all integers that looks roughly like this:
start
stop
first_user_id
second_user_id
The rows get pulled using the following queries:
SELECT *
FROM tbl_name
WHERE stop >= M
AND first_user_id=N
AND second_user_id=N
ORDER BY start ASC
SELECT *
FROM tbl_...
The following query:
SELECT DISTINCT ClassName FROM SiteTree ORDER BY ClassName
is returning things in no apparent order!
I get the same result whether I quote column/table names, or use DISTINCT or not, or add ASC or DESC.
I assumed the indexes might be broken, or something like this, so tried dropping and recreating.
Also tried RE...
I'm trying to update the comments column in one table (Entries), when a new row is added to another table (blog_comments). This code is inside of the PHP function that adds a comment to the DB:
$count = mysql_query("SELECT COUNT(*) FROM blog_comments WHERE entry_title='$entry_title'");
$update = mysql_query("UPDATE Entries SET comme...
We are coding for a MySQL data warehousing application that stores descriptive data (User ID, Work ID, Machine ID, Start and End Time columns in the first table below) associated with time and production quantity data (Output and Time columns in the first table below) upon which aggregate (SUM, COUNT, AVG) functions are applied. We now ...