Hey,
I have a zend app that displays a league table of race results. The basic process is to determine the list of events to be included, and then dynamically add a set of columns to a SQL query. My initial implementation is rather rubbish and i want to refector it. I manually build up a string of SQL and at the very end call db->fetch(...
the image above say what the problem i face to.
if the password and confirm password is not the same,
the box prompt up to choose my DB user.why???
here my code :
else if($_POST['submit']=='Save')
{
// If the Save form has been submitted
$err = array();
if($_POST['confirmset'] != $_POST['setpass'])
{
$err[]='please make sure...
I need a single query that is similar to
SELECT datetime FROM blog WHERE UNIX_TIMESTAMP(datetime) < '".($date_string_in_seconds +1000)."' ORDER BY datetime DESC
but instead of returning the latest date that is smaller than the one given in parameter, it has to return:
-the record with the exact date that is given in the parameter
-if ...
Hello,
I'm writing a project that will make use of mySQL or Derby (it must work in both situations). To solve this I'm using Hibernate and it works nicely, but for a situation: I've a couple of tables that contain cities and towns, with data related so that if i know the town I can join and get the county, state and zip code. These table...
I reinstalled mysql5-server through MacPorts and suddenly my migrations started running a lot slower. rake db:migrate:reset used to take less than a second before. It takes 33s now. When I run it on a Linux machine (or even another Mac), it takes less than a second again. I remember encountering this problem in the past, but I don't reca...
Either I'm being stupid or something's wrong here.
I have two SQL Servers, the one is on my local machine (local time +2 GMT) and the other is somewhere else (NOW() seems to return +8 GMT)and I access it through phpMyAdmin. I have a table that has a DATETIME column. I'm -trying- to store the current GMT/UTC time and then display it agai...
I am going to build a PHP web application and have already decided to use Codeigniter + DataMapper (OverZealous edition).
I have discovered that DataMapper (OverZealous edition) requires the use of an extra association table even when there is actually just a one-to-many relationship.
For example, a country can have many players but a ...
Can someone tell me what is the difference between these two:
ALTER TABLE x1 ADD INDEX(a);
ALTER TABLE x1 ADD INDEX(b);
AND
ALTER TABLE x1 ADD INDEX(a,b);
I know this goes down to the very basics but sometimes I find the former seems to be a little faster than the latter. Is it just my feeling or is there some actual reason for it?...
Hello all!
I need to implement a functionality where a user can upload an Excel file, that is, .xls file and i need to write a function that will read that file and then save the values in a table, compare them to values in another table and then print some kind of billing quotation.
From what I have read, it seems that the best way to...
I have a timestamp field (using the timestampable template) that I want formatted differently in the results for only one SELECT query. Is there a way to pass in a date/time format string in the Doctrine_Query::create() method? Or maybe there's a way with ->setParams() or ->setOptions?
I could format the date in the View using Zend_Da...
Hi,
I have a database called av2web, which contains 130 MyISAM tables and 20 innodb tables. I wanna take mysqldump of these 20 innodb tables, and export it to another database as MyISAM tables.
Can you tell me a quicker way to achieve this?
Thanks
Pedro Alvarez Espinoza.
...
i'm using Python with MySQL and Django. I keep seeing this error and I can't figure out where the exception is being thrown:
Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out of sync; you can't run this command now") in > ignored
I have many "try" and "exception" blocks in my code--if the exception occurred within...
Hi guys,
say you have two tables
table_a
f1 <- PKEY
f2
f3...
table_b
b1 <- PKEY
b2
b3...
now say table_a had a MANY to MANY relationship with table_b
normally you'd have a third table to hold that relationship
table_c
c1 <- PKEY
b1 <- PKEY of table_b
f1 <- PKEY of table_a
also say b1 + f1 for whatever reason could not be the ...
I have the following tables in MySQL server:
Companies:
- UID (unique)
- NAME
- other relevant data
Offices:
- UID (unique)
- CompanyID
- ExternalID
- other data
Employees:
- UID (unique)
- OfficeID
- ExternalID
- other data
In each one of them the UID is unique identifier, created by the database.
There are foreign keys to ensure ...
I have a MySQL workbench model that I've used to generate a schema. To play around with it, I'd like a bunch of fake data. Is there an easy way to generate this, or must I do it by hand?
...
I'm trying to get the following code to display only on specific pages but when I click through certain pages like the home page or any other pages that does not use this code I get the following `alert("some error occured, please try again later");.
How can I have the code not display the alert box on pages that do not use this JQuery ...
Hi, I am thinking of running a hosted service using Amazon Services (PHP + mySQL). What I like to do is have a site where someone registers, pays PayPal and returns to site where they will get an automated information to their mySQL account. So this mySQL account would only be used by them. They can create tables, etc.
Some questions ar...
This query appears to work well:
-- Every supplier that produces some red or green part
SELECT Suppliers.sid
FROM Suppliers, Catalog, Parts
WHERE Suppliers.sid = Catalog.sid
AND Catalog.pid = Parts.pid
AND (Parts.color = "red" OR Parts.color = "green");
To check it, I'd like to look at every SID that will not be returned by t...
$result=mysql_query(" UPDATE xxxxxx_users SET User_Password='$Password' WHERE FstName='$First' AND LstName='$Last'",$db) or die ("Password update successful!");
echo "Update failed, unknown user";
This correctly updates the db when the first and last names match and the db is not affected when they don't. My only issue is I always d...
I am trying to convert my wordpress site which is based on MYSQl to a MS SQL because my we have our main database through MS SQL and we are creating database driven wordpress sites. I have been able to automate all of our wordpress installation + setup through database sripts through MYSQL but all of our variables + inputs are in MS SQL...