|
More site info...
|
|
Forum profile page for Database on http://www.phpbuilder.com.
This report page is the aggregated overview from a single forum: Database, located on the Message Board at http://www.phpbuilder.com.
This forum profile page summarizes the general forum statistics such as: Users Activity, Forum Activity, and Top Authors, which are reported in either a table or graph below for a given reporting time period.
Additional forum profile information for "Database" on the Message Board at http://www.phpbuilder.com is also shown in the following ways:
1) Latest Active Threads
2) Hot Threads for Last Week
Warning: These statistics are generated using 'best efforts' and can experience delays and reporting errors at times. Please note that such statistics do not constitute a forum's popularity and/or exact posting volumes at any given reporting period.
|
|
|
|
|
Posting activity on Database:
|
|
Week
|
Month
|
3 Months
|
|
Threads:
|
37
|
135
|
488
|
|
Post:
|
113
|
359
|
1,314
|
|
|
Database Posting activity graph:
|
Top authors during last week:
user's latest post:
You can't specify target...
Published (2009-11-24 17:27:00)
UPDATE table1 SET active = 0 WHERE id IN ( SELECT table1.id FROM table1 LEFT JOIN table2 ON (table1.name <=> table2.name AND table1.start <=> table2.start AND table1.id <=> table2.id AND table1.ord <=> table2.ord) WHERE table2.id IS NULL) Basically I am trying to find records in table1 but not in table2, and then set up these records "active=0". If I am running the above...
user's latest post:
Help with Updating Database via...
Published (2009-11-20 15:39:00)
Hi Nick, Some hosts have error_reporting turned on by default, some will send the error messages to log file and some have it turned off altogether. So this line just 'equalises' them all! Remember to turn off error_reporting after you've finished debugging. Also, using 'E_ALL' means that you get errors, warnings and notices - have a flick through the manual to see what the difference between these things are. One...
user's latest post:
[RESOLVED] Best table design
Published (2009-11-24 05:53:00)
Thanks for your comments. I can't insert a new row on each update then sum() because each update received by the database is a total in itself. It's an update, rather than an addition. I don't know anything about composite primary keys but after a quick Google I can see the logic and I'll try it. It does seem surprisingly complicated when normally, MySQL and PHP provide quick, simple solutions for anything - which is why...
user's latest post:
Relational Data Modeling and PHP...
Published (2009-11-25 04:26:00)
Good read. I guess I am just struggling with what I have heard before, that objects shouldn't be aware of other objects, or coupled. Which I am finding difficult to do. Thanks for the read and thanks to Martin Fowler.
user's latest post:
Help with Updating Database via...
Published (2009-11-20 14:14:00)
Thank you very much for your help Paul. I was able to get it working correctly. The problem seemed to be, and correct me if I'm wrong, that I was using a disabled text field to pass a value, and I'm guessing this is not possible? Once I set the textfield to read-only, it worked. On a side note, I LOVE the <?php ini_set('error_reporting', E_ALL); code. I had no idea this existing and I wouldn't have been able to...
user's latest post:
Correct in phpMyAdmin but error...
Published (2009-11-17 07:11:00)
That's all I can come up with in regards to SQL. However, you can easily do that in php, for example at the time when you prepare the html for displaying the list (you'll be looping through your results anyway? just include a counter i++). If you want to do it before that - there are plenty of array functions to play around with. Bjom
|
|
|
|
Latest active threads on Database::
Started 1 week, 1 day ago (2009-11-19 07:24:00)
by Weedpacket
The real solution (option A) would be to fix your database schema and then you wouldn't have to be doing this in the first place. Then it would be a straightforward UPDATE statement.
If you have to stick with using PHP to do the database's job for it then option B is .... well, you largely answered your own question: read the field, explode, make the changes, implode, and then update....
Started 21 hours, 49 minutes ago (2009-11-27 06:47:00)
by johanafm
Quote:
Originally Posted by binzy
The number of items in each subcategory is stored as a variable ($numrows) in each subcategory page - I need a way to access the value of this variable on the category page to be able to display it.
Not really. It's stored in a variable when that specific page is requested, and ...
Started 2 days, 9 hours ago (2009-11-25 18:54:00)
by dagon
in the same circumstances I would keep them all in the one table.
Started 3 days, 2 hours ago (2009-11-25 01:37:00)
by Kudose
Relational Data Modeling and PHP Patterns
Does anyone know of any good resources, or if anyone could explain, relational database patterns?
In general, I want to know how to write a model to properly access 2 or more tables.
TIA!
__________________
Problem Solved? Mark this thread ...
Started 1 week, 2 days ago (2009-11-18 12:10:00)
by lightningrod66
[RESOLVED] OMG!! I MESSED IT UP!!
Please take a look at the code below. This was working perfectly fine until I made changes to make the table headers sortable. That didn't work like I hoped, so I deleted all the changes I had made (so I thought) to get back to the original file. Now the headers are displayed, but there are no rows of ...
Started 3 days, 11 hours ago (2009-11-24 17:27:00)
by blackhorse
You can't specify target table 'table1' for update in FROM clause
UPDATE table1
SET active = 0
WHERE id IN (
SELECT
table1.id
FROM table1 LEFT JOIN table2 ON
(table1.name <=> table2.name
AND table1.start <=> table2.start
AND table1.id <=> table2.id
AND table1.ord <=> table2.ord)
WHERE table2.id IS NULL)
...
Started 3 days, 13 hours ago (2009-11-24 14:45:00)
by youknownb
Blob HELP Please
I am doing a website with a database for a class project and I am using blob's in the database to hold images( i know that its not good to do this but its only a project, I just need a working copy so I can graduate). I've been searching the net for almost 3 days straight and everything I try doesn't work. I'm not proficient...
Started 3 days, 15 hours ago (2009-11-24 13:17:00)
by blackhorse
find records in t1 but not in t2, but has null value
Code:
SELECT column1,column2,column3
FROM t1
WHERE (column1,column2,column3) NOT IN
(SELECT column1,column2,column3 FROM t2);
I can use this query to find records in t1 but not in t2. But this query only will work if column1, column2, column3 are ...
Started 3 days, 14 hours ago (2009-11-24 13:55:00)
by blackhorse
mysql text field not null, default
In mysql, I can set up a text field as "not null" but I cannot set default value for the text field.
Say then later on, if the insert query trying to insert a null value into that "not null" texgt field, what would happen? Would it automatically coverted to empty string?
Thanks!
Started 3 days, 15 hours ago (2009-11-24 13:21:00)
by arun.chandel86
how to play vedio files in embeded mediaplayer whose path is taken from database
hi everyone
i am in troble . i wanted to play video files in embeded player on web page whose source path is retrieved from mysql database..actualy i was trying to store and retrieve vedio files from database...i hv used the technique to first store the ...
|
|
Hot threads for last week on Database::
Started 1 week, 1 day ago (2009-11-19 07:24:00)
by Weedpacket
The real solution (option A) would be to fix your database schema and then you wouldn't have to be doing this in the first place. Then it would be a straightforward UPDATE statement.
If you have to stick with using PHP to do the database's job for it then option B is .... well, you largely answered your own question: read the field, explode, make the changes, implode, and then update....
Started 1 week ago (2009-11-20 13:17:00)
by nickminute
Help with Updating Database via HTML Form
I am very new to PHP and am having some difficulting updating my record in a database via an HTML form. Here are the three steps of what I'm trying to accomplish.
Step 1: Pull a record from a database (which is done)
Step 2: Give the user the ability to edit the record information via text and ...
Started 1 week, 1 day ago (2009-11-20 03:45:00)
by phpSimon
[RESOLVED] Best table design
Hi all
I have a table which stores total revenue, by day, for a number of businesses - a bit like this:
id - INT, PRIMARY
date - DATE
businessname - VARCHAR (30)
totalrevenue - DECIMAL(12,2)
The problem with this is that I update the revenue regularly - more than once a day, which generates ...
Started 3 days, 2 hours ago (2009-11-25 01:37:00)
by Kudose
Relational Data Modeling and PHP Patterns
Does anyone know of any good resources, or if anyone could explain, relational database patterns?
In general, I want to know how to write a model to properly access 2 or more tables.
TIA!
__________________
Problem Solved? Mark this thread ...
Started 1 week, 2 days ago (2009-11-18 12:10:00)
by lightningrod66
[RESOLVED] OMG!! I MESSED IT UP!!
Please take a look at the code below. This was working perfectly fine until I made changes to make the table headers sortable. That didn't work like I hoped, so I deleted all the changes I had made (so I thought) to get back to the original file. Now the headers are displayed, but there are no rows of ...
Started 1 week ago (2009-11-20 19:29:00)
by zzz
exclude from results
I have a query that gets item IDs from a table t1.
I also have another table, t2.
PHP Code:
t2
------------
itemID
event1 // 0 or 1
event2 // 0 or 1
I need to rewrite my t1 query to exclude item IDs if it corresponds to t2.itemID and if t2.event2 = 1...
Started 1 week ago (2009-11-20 20:09:00)
by Mariniertje
Need help displaying results of FOREACH in 4 columns
Hi guys,
I need some help.
I have a .inc file for the queries and a separate php file to echo the results.
Now what I want to do is echo 2 results per line, but I can't find the right solution on the internet. Now I am quite new to this, so it might be just my inability to ...
Started 3 days, 13 hours ago (2009-11-24 14:45:00)
by youknownb
Blob HELP Please
I am doing a website with a database for a class project and I am using blob's in the database to hold images( i know that its not good to do this but its only a project, I just need a working copy so I can graduate). I've been searching the net for almost 3 days straight and everything I try doesn't work. I'm not proficient...
Started 3 days, 15 hours ago (2009-11-24 13:17:00)
by blackhorse
find records in t1 but not in t2, but has null value
Code:
SELECT column1,column2,column3
FROM t1
WHERE (column1,column2,column3) NOT IN
(SELECT column1,column2,column3 FROM t2);
I can use this query to find records in t1 but not in t2. But this query only will work if column1, column2, column3 are ...
Started 3 days, 20 hours ago (2009-11-24 08:09:00)
by camarosource
HELP: HOW TO - Duplicate ROW content to new ROW
I am wondering if there is a way to DUPLICATE (MOST) of the contents in a mysql ( phpmyadmin) ROW into a new row? Obviously not duplicate the primary since that needs to be unique.
I just need to know if there is a SQL to duplicate the fields and contents from one row to a new row. I can ...
|
|