I have a table with a few thousand rows in it that has a few integer columns and a blob column. I want to dump each row out as its own file with the blob being the content and the integers being used to form the file name. This is a one time op so quick and dirty is OK. One constraint is that I have almost no tools installed in this envi...
I've got this table. The table has a bunch of char fields, but the field in question (expiredate) contains a char on the test_tmp table, and a datetime on the test table. (Table names have been changed to protect the clients.)
In the test_tmp table, the field contains a Month-Date pair, like 'Aug 10' or 'Feb 20'. The code I'm using t...
I am adding a few new features to a small project i'm working on and one of them is alpha pagination which looks like
# 0-9 A B C D E ... X Y Z
I can easily fetch items by their first letter using something like
SELECT * FROM ... WHERE name LIKE 'A%' ...
Grouping everything that starts with a number and all other characters is a...
I'm currently in the middle of working on a CMS system that builds the website straight from information saved in a MySQL database.
Here's the problem I'm having:
Inside the CMS the user enters coding for a template
the frontend of the site (frontend.php) calls the variable where the layout is stored ($template_header)
The frontend a...
Hi,
I'm writing a C# application which needs to insert about 600K records into a database at a certain point in time.
They are very simple records: just 3 longs.
I'm using params to set up the command, and then loop through the data in memory to make the inserts, assigning the values to the command parameter's at each loop and runnin...
Is there a way I can piggy back sessions to know is the user is online?
I.e: use logs on, I set a $_SESSION variable, user times out- cookie Garbage collector updates the database to update their status as offline.
EDIT: I want a solution that does not involve times or dates. I want something to ride on sessions or something similar. ...
I have 3 tables in my DB (MySQL).
categories (name:string)
items (name:string, category_id:int)
votes (value:int, item_id:int, created_at:datetime)
So a category has many items, and an item has many votes.
I want to write a query to get the most popular categories, which means getting the categories whose items have gotten the most n...
So I'm trying to build a simple forum. It'll be a list of topics in descending order by the date of either the topic (if no replies) or latest reply. Here's the DB structure:
Topics
id, subject, date, poster
Posts
id, topic_id, message, date, poster
The forum itself will consist of an HTML table with the following headers:
Topic | Las...
I have a table containing data about some users.
Many of them use our in house email system at OLDHOST.com. We have updated to a newer system at NEWHOST.com. All the users usernames are the same, so if you had [email protected], you are now [email protected]
Is there a better way to change all the email fields in the users table without ...
So, I have a field in my users table named last_active which updates every time a user reloads a page. It's stored in unix timestamp.
I would like to output it like this: Last online: 4 d 18 h 19 m ago
How would one do that? Can you do it with php's date()?
Thank you.
...
ProgrammingError at /account/register/
(1110, "Column 'about' specified twice")Request Method: POST
Request URL: http:
Exception Type: ProgrammingError
Exception Value: (1110, "Column 'about' specified twice")
Exception Location: /home/temp/lib/python2.6/site-packages/MySQL_python-1.2.3c1-py2.6-linux-x86_64.egg/MySQLdb/connections.py...
My server time is in GMT, and I do the following whenever someone comes online.
// Set a default timezone
$defaultTimeZone = 'America/Toronto';
// load the user, if they are online...
$onlineUser = new user();
if (isset($_SESSION['user_id']))
{
if ($onlineUser->loadUser($_SESSION['user_id']))
{
$defaultTimeZone = $onlineUser->timeZ...
I have Flex application with UT8-encoding. It is sending back to the Server (PHP), and the data gets written in to Mysql (UT8 charset, utf8_general_ci). I have no problems at all writing/reading Umlaute from/to the database.
I only realized, by looking at the data with PHPmyadmin that the Umlaute get somehow converted to:
ö => ö
ü => ...
Hello all,
I have just uploaded an image to imageshack using their API and I am trying to save that image path that I get back from imageshack.
$mgr->setUploadUrl('http://www.imageshack.us/index.php');
$fileImagePath = $row['cr_path'];
echo $fileImagePath.'<br><br>';
$res = $mgr->upload($row['cr_path'], 'image/jpeg', 'avaojo');
$n...
I'm in the process of updating my Symphony installation and I've been told to "run these MySQL commands" to complete the process. Funny thing... I have no idea how to do that. The commands I'm mean to run are as follows:
ALTER TABLE `sym_sections` ADD `navigation_group` VARCHAR( 50 ) NOT NULL DEFAULT 'Content';
ALTER TABLE `sym_sect...
methods like mysql_fetch_array move the internal resource pointer on a MySql result set, but how do you get the current value of the internal resource pointer though? Is there a "mysql_" method that returns this value?
...
I'm pretty green on mysql and I need some tips on cleaning up a query. It is used in several variations through out a site. Its got some subquerys derived tables and fun going on. Heres the query:
# Query_time: 2 Lock_time: 0 Rows_sent: 0 Rows_examined: 0
SELECT *
FROM (
SELECT products . *, categories.category_name AS category, ...
Hey everyone,
I'm designing a database for an organization that has multiple "types" of users. At first, I created only one user table. However, while all users share some common information (first name, last name, username, password, etc.), each user type requires one or two additional fields that are not applicable to all users. While...
how to read my blob column from mysql to string type in hibernate
I have try this way but alway return me:
[B@196f4b5
Article article2=f.daoArticle.findById(article.getSrcUrl());
String vbody = article2.getArticle();
System.out.println(vbody);
\\hbm
<class catalog="ariso" name="countaword.ariso.dao.Article" table="a...
I face the following problem
function book($memberid, $classid){
if (!book){
// update the db and change the book variable to true
}
}
My problem is 2 requests submitted at the same time.
The first request passes the line if (!book){ but not yet update the db. And at the same time, the second request runs the same function and also p...