Home » Databases » Page 4
How do I use content from one field, to UPDATE to another?
by ack in Databases
Syntax: [ Download ] [ Hide ]Syntax: [ Download ] [ Show ]UPDATE categories SET titletag = 'Stone Selection: <title>''
I Want to update a load of fields to show A particular word, followed by the content of the field.
So if "title" field says "Special", I want the above script to update categories to say: Stone Selection: Special.
How do I do this?
Cannot do it with Stone

MySQL - getting dates from a table earlier than today
by ArdentRogue in Databases
I have a table with two fields, EventID and EventDate.
Each EventID may have one or more dates attached to it (stored in the format YYYY-MM-DD). I want to run a query that returns any EventIDs where the latest date that an event runs is earlier than today.
"SELECT EventID FROM `eventDates` WHERE EventDate<'$today' ORDER BY EventID" returns all EventIDs earlier than the current

database structure for drop down options in form
by Blunc in Databases
I want to build a form with drop down lists of car makes and models
The first option will be make of car and the second will be the model of the car.
I will pull the information in from a database to fill in the second option dependent on the make of car.
Does anyone know the best structure of table to create this?
Would it be best to use 2 different tables? One for mak

Problems with booleans
by bikefixxer in Databases
I have a column set to the tinyint or bit type which must allow NULL values because the insert/updates may not contain an explicit value for the column. This means that when I query the column, I can't simply do something like "where columnname != '1' beause it will ignore the Null values, so I have to do: ...where columnname is null OR columnname ='0'
This can't be the right way to do it.

Count and list items in the same query
by Georgia in Databases
This may be a very simple question but I was not able to find an answer. Forgive me if I am posting in the wrong discussion. I have not been on this forum for quite a while.
Syntax: [ Download ] [ Hide ]SXBB[id].writeCmd();Syntax: [ Download ] [ Show ]id      name    type    price
123451  Park's Great Hits       Music &n

Query if a value does not exist in a table
by Gunbuster in Databases
i run a small sporting association website, am querying 2 tables no problem:
SELECT scrs.scrsID, scrs.MemberID, scrs.team_grade, scrs.team_id, scrs.played_S1
FROM scrs, members
WHERE scrs.MemberID = members.MemberID
AND scrs.team_id =32
GROUP BY members.MemberID
ORDER BY members.MemberID
I have a 3rd table that holds members financial information - the table rela

Plesk11: how do you whitelist an IP in Remote MySQL?
by rancherlee in Databases
We need to connect to one of our other site's databases, but it seems to be blocking it.
In cPanel it's easy to whitelist an IP and grant access, but I cannot see where you do this in Plesk11.
I hope it's not on SSH as that scares me!
Any help would be great. Surely there is something in Plesk11 for Blocking / Accepting IPs?

Delayed errors and Handler_read_rnd_next?
by Geoffrey De Smet in Databases
I'm getting a lot of delayed_errors in my MySQL status report, and it says: "The number of rows written with INSERT DELAYED for which some error occurred (probably duplicate key)."
What does it mean by 'duplicate key'?
I have no INSERT DELAYED commands at all. :/
Handler_read_rnd (The number of requests to read a row based on a fixed position. This is high if you are doing a lot of

ORDER BY query very slow - how to optimise?
by Gold in Databases
On my site's forum there's a posting history page to see all the forum posts that a user has made. According to my webhost, this is using up a lot of server resources, but I don't know how to optimise it:
Syntax: [ Download ] [ Hide ]Syntax: [ Download ] [ Show ]SELECT * FROM f_posts WHERE author='$name' ORDER BY postid DESC LIMIT $x, $y
The query takes 0.1253 sec (and is even longer if

Capture and insert an auto incremented value
by Excessi0n in Databases
Hi Everyone,
I'm trying to help out a classmate from a Javascript class I'm taking. He created a website with a MySQL database and had problems with foreign constraints. About 5 years ago, I had been using phpMyAdmin to do some testing of INSERT statements. I was able to insert a “user name” and other personal information into a “user” table, and then take the “user_id” (auto incr

Can you query on a db "localhost" "root" error?
by 1sikbITCH in Databases
We need to monitor a web site, to see if the database goes down.
Generally that side goes down, and a few minutes later the SQL side has been crashing.
It's stable now, but I want a monitoring script.
The error which is like this:
Syntax: [ Download ] [ Hide ]Syntax: [ Download ] [ Show ]Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC

Tracking Database for Photographers [Design/Setup Questions]
by reflexiv in Databases
I have a lot of experience developing websites, but not much developing larger systems with many users. So I'd really like some advice in general database structure for a site consisting of many users and much more data (such as a forum). Currently I'm using MySQL via PHP's MySQLi extension.
The site I'm working on is a database for photographers/filmmakers to store/create information such

Certain words will not save to the database?
by Yst in Databases
I am currently using $mysqli object to handle all of my database interactions. Locally when saving things to the database everything works. However, on the live server if the word "from" is in the body of text trying to be updated, it will break the query when trying to save. Previously when using the procedural mysql_ functions I had no issue as well.
If it helps, my local setup is Mac OS

Get a specific list of postcodes with MySQL Like Operator
by gqlewis in Databases
Hi everyone.
I have list of postcodes. And what i'm trying to do is get a listing of similar poscodes only.
My Code:
Syntax: [ Download ] [ Hide ]SXBB[id].writeCmd();Syntax: [ Download ] [ Show ]$postcode1 = ereg_replace('[^A-Za-z]', '', $postcode);
SELECT * FROM coverparked WHERE postcode LIKE '$postcode1%' ORDER BY postcode
So then $postcode1 strips a

Can you replace 2 char at start of string, with 2 others?
by whatintheworldisthat in Databases
We have 766 rows in a DB. Each have a value in a romancode field, such as, ie6573875, and we want to find the first two characters, "ie", and replace them with "us".
I would just do a simple Find and Replace IE for US, but there may be codes like this: ieXLPPIE24.
So it has to be TWO characters at the start only.
I thought it would be a CONCAT statement, it's not - it's a REPLACE.

Can you open a separate hosted DB from within another?
by davidar in Databases
We have web sites that run in multiple countries.
They have their own databases.
We need to check via the UK site, if a product is held on each of the other sites.
There is a primary code used, (tho it varies with two characters at the start).
I need to open the UK conn, query for each code, and test that code against each other site. If found, update the UK site.
It woul

how to increment login days while log in by mysql UPDATE?
by mvt in Databases
have following structure in a mysql table:
Syntax: [ Download ] [ Hide ]Syntax: [ Download ] [ Show ]id || username || lastlogin || days
1  || user-xyz || 2013-04-29 || 0
The above 'lastlogin' column is date column and 'days' column is int(3) column. What I want to do, while a user will login, lastlogin column will be updated everytime as usual. At the same time, th

Replacing nested queries for optimisation?
by Hubb1e in Databases
My webhost said that my site's MySQL coding had a lot of nested queries, which was placing a lot of stress on the server.
One instance of this is where the code grabs the 8 most recent posts made on the forums, retrieving data from two tables: f_posts (which has all the posts listed with associated threadid) and f_threads (which has all the threads listed with associated thread subj

How do I add characters to end of multiple field data?
by Dean in Databases
We have 400+ filenames in a database, ie. 45454343. I need to change them all to 45454343.jpg for instance. So they all have ".jpg" put on the end.
How can this be done, via phpMyAdmin? I'm assuming it some kind of "replace" function, but not sure.

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .