I need to build an activity feed to go on each users profile page showing what they have been doing on the site.
There is three tables: comments, ratings, users
I want the feed to include the comments and ratings that the user has posted.
in the comments and ratings table it stores the user id of the user who posted it, not the userna...
I have a closed-source upgrade application which migrates my database from an old format to a new format (creates new tables and migrates data from the old to new tables).
The application crashes with a MySQLIntegrityConstraintViolationException. It doesn't give me the name of the table with the primary key violation or the contents of ...
Hi, I finished a web page in my computer and it was saved in my pen drive. Now I uploaded the files .html and .php to the server, and I exported the database of my pen drive and imported it on the web address using phpmyadmin. Seems like I'm having the following problem:
Warning: mysql_connect() [function.mysql-connect]: Can't connect ...
Hi, i've programmed a mysql backup system for my CMS which dumps all the DB data and structure into a gzipped .sql file:
$filename = DB_NAME.'_'.date('Y.m.d_H\hi_(s.'.round(microtime()*100,0).')').'.sql.gz';
exec('mysqldump --default-character-set=UTF8 --opt --compress --host='.DB_HOST.' --user='.DB_USER.' --password='.DB_PASS.' '.DB_NA...
Hi, I'm using the function
$data=date_default_timezone_set("Y-m-d");
and I'm getting the date like 0000-00-00 in my table. Can any one help me ?
...
I would like to ask those web developers who do freelance what their development process is for creating quick, simple websites for clients. The kind of sites I am referring to would be simple sites for small businesses. Maybe 4-8 pages, a contact form, simple jquery slide show, that type of thing.
What development methods / process hav...
I've got a design decision to make and am looking for some best practice advice. I have a java program which needs to store a large number (few hundred a day) of floating point arrays in a MySQL database. The data is a fixed length Double array of length 300. I can see three reasonable options:
Store the data as a BLOB.
Serialize th...
I'm trying to do a query to filter on rows from one table and then join the results on another table and then filter out additional rows.
Here is the query I've written:
SELECT *
FROM (SELECT media.id AS id2, media.flagged AS flagged2, media.item_status AS status2
FROM media
WHERE flagged2 != 'nsfw'
...
For fun I am replacing the mysqli extension in my app with PDO.
Once in awhile I need to use transactions + table locking.
In these situations, according to the mysql manual, the syntax needs to be a bit different. Instead of calling START TRANSACTION, you do it like so...
SET autocommit=0;
LOCK TABLES t1 WRITE, t2 READ, ...;
... do ...
I have a photos table, with two columns in that table named "id" and "user_id". Obviously one user can have many photos. I'd like to run a query that can give me the photo count for each user.
Any help is appreciated.
...
I know this isn't a directly programming related question but I need some help in deciding which book to buy. I usually never buy books, instead I download instructional videos and ebooks from file sharing sites. But I want to buy one big fat book now that I can read on the subways to and from work.
So for MASTERING php/mysql which book...
What does the query show innodb status return?
...
How do I get a time countdown using PHP?
I want to display something like 3Days 4Hours. I have a date field coming from MySQL table and want to calculate it with today's date. As of now I have only date and not the time stored in the database, but eventually I will. So at that time, I might show as 3Days 4Hours 10Minutes 43seconds.
Th...
Is it possible to retrieval databases of anther permitted website's server. and the full data must be replicated and updated frequently to my server.
...
I have a MySQL table which basically serves as a file index. The primary key of each record is also the name of a file in a directory on my web host.
When the user wants to delete a file from the system, I want to ensure some kind of transaction safety, i.e. if something goes wrong while deleting the file the record is not erased, and i...
Hi guys, I need to get all of the users in my user table and then get the results as an array and traverse through it and create a XML file for each user.
How would I go about doing that?
I am guessing the query would be something like SELECT * FROM users but I am unsure as to how I can get all the results as an array and then how to t...
Hi all
I have problem using REGEX in Mysql
I have oid value in database like this
id -> value
1.3.6.1.4.1 -> Value a
1.3.6.1.4.1.2499.1.1.2.1.1.1.1.1 -> Value b
1.3.6.1.4.1.2499 -> Value c
And my objecttives are
1. To get single oid & value with the specific oid that i put into sql statement
2. If no specific value the...
When I try inserting binary data into a blob column of a MySQL database using MySql.data.dll , the following exception is thrown- error in syntax near '\b\0\0\b\0\0��\0\0'.
Following is my code snippet:
byte[] arrayData = memoryStreamFromFile.ToArray( );
cmd.CommandText = "insert into `attachmentdata` (`data`,`blobid` ) values ...
It's a bit difficult getting my problem into a short form, so I apologise if the title doesn't make sense.
Anyway, here is the problem:
$query = '
SELECT issues.*, comments.author AS commentauthor, favorites.userid AS favorited FROM issues
LEFT JOIN comments ON comments.issue = issues.id AND comments.when_posted = issues.when_upda...
Hi all,
I'm using one of my MySQL database tables as an actual table, with times of the day as each column, and one column called day. You guessed it, in day it says the day of the week, and in the rest of the cells it says what is happening at that time.
What I want to do is only show the cells that have value in it. In my case, I'm al...