mysql> select * from products;
+---------+-------------+-----------+------+
| prod_id | prod_source | prod_type | flag |
+---------+-------------+-----------+------+
| 1 | USA | 2 | 0 |
| 2 | USA | 2 | 0 |
| 3 | USA | 2 | 0 |
| 4 | USA | 3 |...
For my blog, I want to incorporate my own commenting system without relying on the default wordpress commenting system. I need the comments module to utilize mongodb instead of mysql and the module needs support for the following:
Threaded comments
Comment Voting
The votes on comments need to be aggregated per each comment author f...
On a centos,
qt creator 1.2.1
qtsdk-2009.04
what step by step is needed to create mysql driver, in linux and in windows.
such that running following command gives an positive output
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("xxxxxxxxxx");
db.setDatabaseName("xxxxxxxdb");
db.setUserName("xxxxxxxxxxx");
db.se...
can any one tell me the difference between mysql_connect and mysql_pconnect?
...
I not sure which one would use less execution time if the user is advertising a classifieds ad and did not upload any image, a 'blank.jpg' would replace the image in HTML code.
which is: <img src="blank.jpg">
For the PHP, I use if-conditional when read data from mysql and replace '0' value with 'blank.jpg', would it be optimal if the d...
I'm integrating 1 script as backend for another. Both the scripts uses PHP/Mysql. There is however one catch as in the "Users" table the frontend uses "id" for the user's id & the backend uses "uid".
Is there any way to give two names for the same column so that the modding can be done easily ?
...
I have been trying to display image from database using php but i am only getting download prompt whenever i use or click the link. what i want to do is, i want to display it on the web browser. And want to use it in tags.
my code is:
require_once('dbconfig.php');
$cont=mysql_connect($dbhost,$dbuser,$dbpass) or die("Error Conn...
I'm performing an update on a MySQL table (myisam engine) that, according to the profiler, is spending an inordinate amount of time in the 'init' state:
mysql> show profile for query 2;
+----------------------+-----------+
| Status | Duration |
+----------------------+-----------+
| starting | 0.000057 |
| ch...
Hi All,
MYSQL running on my machine is V-5.1.40
I am able to partition the Table as i wanted but when i am trying to query using the key which i used to partition the table it does not take effect it still considers all the partitions
below is the code i used and its o/p respectivly
ALTER TABLE testTable REMOVE PARTITIONING;
ALTER T...
Hi, i have a design issue regarding sending user data from a mobile phone app to a server (Debian 5 LAMP). I need to send various details such as username , date of birth, customer order no. etc. These will be passed onto a C code app (always on process)running on the server.
I am currently using named pipes for IPC between my external ...
Hello, I am not a guru of databases, do most of the things through PHP, like data manipulation as well, even if it is an internal task. However, PHP is not being very useful in this case. I have a table with about 0.4 million records in it and it has like 16 columns, everything else works fine but I populated this table from a text file ...
Say I have two tables, user and comment. They have table definitions that look like this:
CREATE TABLE `user` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`username` VARCHAR(255) NOT NULL,
`deleted` TINYINT(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY (`username`)
) ENGINE=InnoDB;
CREATE TABLE `comment` (
`id` ...
//check which faction members are online
$sql = mysql_query("SELECT * FROM ".TBL_ACTIVE_USERS."
WHERE faction=$userfaction_id ORDER BY timestamp DESC,username");
//no '' around var as it is an integer, so php doesn't expeect it to be string
$numrows = mysql_numrows($sql);//gets number of members online
if($numrows == 1){ echo 'You are t...
Hi all,
I'm looking for a PHP class that would draw me (by fetching data from a mysql table) a competition playoff table in HTML similar to what they do on wikipedia (see under the "Bracket" section):
http://en.wikipedia.org/wiki/2009%E2%80%9310_UEFA_Europa_League_knockout_phase
Any input?
Thanks
...
Hi,
I have two tables : DISH and DISH_HAS_DISHES. Dish table has all the dishes and "Dish_has_dishes" table has a one-to-many relationship with "Dish" table. I.e. a dish can have multiple dishes. For example
DISH :
dish_id dish_name
1 dish_1
2 dish_2
3 dish_3
4 dish_4
DISH_HAS_DISHES :
meal_id d...
I have a table which has a column with numbers (no specific order).
What would be the shortest way to insert the minimal number in this column into $min variable in PHP ?
...
Say I have four tables:
------------- features --------------
id: int
name: varchar
-------------------------------------
-------- feature_categories ---------
feature_id: int
category_id: int
-------------------------------------
----------- categories --------------
id: int
name: varchar
-------------------------------------...
Hi,
I have a form which uploads multiple file fields into a db using codeigniter.
I need to be able to upload multiple files for each field. I understand that this could be achieved using some jquery magic, however, my problem is how do I intercept the multiple files and what is the best way to store them in my database?
At the minute...
How to select 1st, 3rd, 11th and nth row from a table?
...
I try to execute the following command and receive this error:
[root@localhost ~]# isql -v asterisk-connector
[01000][unixODBC][Driver Manager]Can't open lib '/usr/lib/libmyodbc.so' : /usr/lib/libmyodbc.so: cannot open shared object file: No such file or directory
[ISQL]ERROR: Could not SQLConnect
I have checked and libmyodbc.so does...