I have a database row whose type is "timestamp". It automatically populates each time a new record has been added with the time of that record's insertion. Right now for one of the records it holds the value:
2010-06-19 18:40:51
I tried to turn this in to a more user friendly format by:
$timeStamp = $row['date'];
$timeStamp = date( "...
please advise on the following, and if you were to do something different please let me know.
with a c# app i am auditing conversations between cellphones. here's what happens:
someone sends a text to my phone which is attached to my computer
my c# catches the message and it forwards it to another phone number
the person receiving the...
I am using the MySQL Connector.
using (MySqlConnection connection = new MySqlConnection("..."))
{
connection.Open();
MySqlCommand command = new MySqlCommand();
command.Connection = connection;
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "FN_NEW";
command.Parameters.AddWithValue("P_SES...
i am still deciding on the database schema, but i will have chats saved in a database table. the mysql db will constantly be updated. what would be the friendliest way to display the data from the database? should i just use php to do it? is there something easier? can soemone give me examples of code of how to display the data in a fri...
Hello,
I currently have a list of defined constants and a function that regex'es every pulled MySQL string and looks for things like CLIENT_NAME, LOCAL_API_ADDRESS and auto-changes it.
// several fields
define ('CLIENT_NAME', '...');
define ('LOCAL_API_ADDRESS', '...');
...
The thing is, as my app is getting larger I feel this is pre...
I have the following code that is able to create a class that has a single static instance of the database object, and two static functions for rows and columns.
<?php class Database{
private static $instance;
private function __construct() {}
private function __clone(){}
public static function call(){
if(!iss...
I want to serve an image saved as a blob in a MySQL Database through hibernate3 in a JSF application. My intention is that /myapp/image/get.faces?id=x will serve the image saved in the database with id x. How to achieve this?
...
Hi,
I'm working on a busy web site. Sometimes it gets much more traffic then avarage days. The content is cached but as site's owner want to see realtime post views it has to do at least one query to MySQL per post view which is become performance problem under heavy load.
All I can think of is create a different table for views and upd...
I'm pulling several status over a specific time period and I'd like to pull another stat that would be "average sales per day" over this time period. I'm not sure how to do daily averages over a specific time period, can anyone provide some advice?
$whereSql = 'WHERE created >= '.$endTimestamp.' AND
created <= '.$startTime...
hi all..
i want after i've been submit form it can show hit counter..
but i want after it reach "20" it can back to zero..bcoz the limit of submit is 20 times so it can't over the limit.
how do i make it works?I've been try to this code...
<?
$limit="20";
$Query_counter=mysql_query("SELECT model FROM inspec");
$Show_counter=mysql_fetch...
I have a backup system..... that backs up a folder every 5 minutes. The backup can be assigned to any device using its IP Address. But once a week or once a month that device is rebooted, and we want to turn the backup off every week or month on a certain time for certain seconds. Creating the database table shouldn't be a problem, I was...
I'm getting the following error...
ERROR:
mysql error: Unknown column 'thread.threadid' in 'on clause'
I hear it has something to do with the MySQL version... what changes do I need to make to my PHP code to get passed this error? I read that This error arises because the comma operator was used in the SELECT query. This query was n...
One of my hosting server does not support PDO. Are there and mysql_ commands which does the same function of PDO's prepare() and execute()?
I am looking for the parameter substitution feature, i.e. VALUES (?, ?).
...
I'm trying to query a Wordpress database and get the post titles to sort in a correct order.
The titles are formatted like this: Title 1, Title 2.. I need to sort them in ascending order, how can I do this? If I just sort them ascending they will come out like: 1,10,11...
Right now my order by statement is this but it does nothing:
ORD...
I've double-checked my schema, and its correct... infact doctrine also built it once.. and now its troubling me with some FK relations...
I have checked for the data-types as well. All are int(4) or int(2)
2 Qs here:
1. is there an upper limit to the no of relations (dependencies/FKs) a table can have?
I have upto 7 FKs in a tables
2. i...
I have a MySQL table containing phone numbers that may be formatted in many different ways. For instance:
(999) 999-9999
999-999-9999
999.999.9999
999 999 9999
+1 999 999 9999
9999999999
019999999999
etc.
The field is stored as a string. All I want to do is return the field with anything non-numeric removed. What SQL could be used to...
How to store log in MySql database using log4net
...
Hi I was wondering if there was a simple solution in mysql to truncate mysql entries.
i.e.
if i want only a maximum of 100 entries in one table if a new entry is submitted, (101st entry) then it would delete lets say the last entry ( ordered by a time stamp ) and insert the new one (still only having 100 entries).
Any help much apprec...
I don't know this concept is there or not. Can we store the Files and related information in MySQL database ? If the answer is Yes then how ?
...
I have a table with this structure (simplified):
artID: 1
artName: TNT
ArtBrand: ACME
...
And I want to normalize it making a separate table for the brand (it will have additional data about every brand)
So I want to end up with this
article table:
artID: 1
artName: TNT
brandID: 1
...
brand table
brandID: 1
brandName: ACME
brandI...