How can you put an array to the WHERE -clause below without creating 50 pg_execute -commands in PHP / PostgreSQL?
// to get the question_ids of the newest questions
$result_q_id = pg_prepare($dbconn, "query6", "SELECT question_id
FROM questions
ORDER BY was_sent_at_time
DESC LIMIT 50;"
);
...
I have developed an network application that is in use in my company for last few years.
At start it was managing information about users, rights etc.
Over the time it grew with other functionality. It grew to the point that I have tables with, let's say 10-20 columns and even 20,000 - 40,000 records.
I keep hearing that Access in not g...
How can you have IN -clause in ON -clause with LEFT JOIN?
I am trying to select the title of a question, tag(s) for the question and question_id for the question from my database such that question_id is 14. I expect to the tags and title of the question with question_id 14.
The output should look like
title | question_i...
I've been requesting MySQL results and looping through them like this:
$query = "SELECT * FROM $table";
$result = mysql_query($query);
for($i = 0; $i < mysql_num_rows($result); $i++){
echo mysql_result($result, $i, $row);
//do something else;
}
you can probably see what happens. What if a row has been deleted? What if the firs...
How can you get many tags for a question effectively from Postgres database by PHP?
I have tables tags and questions where I have the variables questions_question_id and question_id, respectively, for instance.
One question may have many tags.
I can select question_id, title and a tag from the tables.
However, I do not know how to get...
I am continuing to delve into Erlang. I am thinking of starting my next web project using Erlang, and at this stage the only thing I will really miss from Ruby on Rails is ActiveRecord.
Is there a good alternative technology for Erlang?
Update:
The closest I have come to a solution is to ErlyDB, a component of ErlyWeb.
ErlyDB is a...
I've a table where I've two fields:
dateCreated
dateUpdated
I want both fields to hold timestamps, dateCreated to have a DEFAULT CURRENT TIMESTAMP flag and dateUpdated to have a ON UPDATE CURRENT TIMESTAMP behavior, however seems that I can't have more than one timestamps field types on the same table.
It would be really useful if th...
New to Joomla and mySql environment. Created a Joomla test environment on localhost but did not name the mySql database to that of the target ISP. Is there a way to rename the database so I can load to ISP?
...
Hi folks,
I have a python application that opens a database connection that can hang online for an hours, but sometimes the database server reboots and while python still have the connection it won't work with OperationalError exception.
So I'm looking for any reliable method to "ping" the database and know that connection is alive. I'...
I'm essentially looking for a "@Ignore" type annotation with which I can stop a particular field from being persisted. How can this be achieved?
...
Hey everyone, I am currently building a highly efficient website on culinary recipes (let's just put it that way).
Each recipe has 10 or less ingredients.
So given an ingredient, how can I find 1) All the recipes that the subject is present, and 2) All the other ingredients that are present in each of the recipes in 1) QUICKLY.
My ini...
So I am a little confused on the object oriented part of PHP. Right away I will apologize for the fact I know very little about PHP and databases.
My question is when your making per say a database to hold users in it, why would you want to make a class/object for that user when you can just pull info from the database.
Also if you ...
An application runs training sessions. Environment for each session (like "mission" or "level" in games) is stored in a database.
Before starting a session, user can choose which of many available databases to use.
During the session database may be modified.
After the session changed database is usually discarded, but sometimes may b...
I am working on a pre-existing MS SQL Server database that was not designed very well. Indexes and primary keys were missing in most cases. There were NO foreign key constraints.
I made a local copy of the DB (so as not to work on the live version), and fixed most of the problems. I now want to syncronize my changes to the productio...
Hello everyone,
I often find myself spending a lot of time figuring out why certain SUM()-aggregates sum up wrongly in SQL-queries. This problem often occurs if I do not take care when adding a JOIN, resulting in duplicate values being summed up etc. If I work with a big query with lots of JOINs, nested subqueries, GROUP BYs etc. things...
I have a large complex multiple table in one database that customers use with a FE/BE link over some LAN networks which occasional corrupt the database
I was wondering if grouping the tables into separate multiple databases and using separate links would help limit the damage?
Note: I have no control over customers network quality and ...
I wanna build a Win32 app of Client/Server (or 3-tier) type with follow features:
When the "A" client does a modification (update,insert, etc) into a database, the rest of clients viewing the same record set can get almost "instantly" a fresh view of this data
a client can be notified when a connection to database get lost
could some...
Hi Folks,
I'm looking for a good caching strategy for an CRM App written in ASP.NET. Almost all sites depend heavily on the database, which means caching parts/the whole page for some time does not work in my situation. Is there any other way you use caching in these situations?
Thanks very much,
Steve
...
as far as I understand postgres, mysql or oracle will be wear out ssd disk very fast.
I need one INSERT query per few second and statistic processing of inserted lines per 24 hour.
platform: linux
...
Hello!
I'm trying to insert some japanese words in a mysql table!
If I insert 'こんにちは' using phpMyAdmin, the word is displayed fine from phpMyAdmin.
But if I try to insert it through php, as follow:
mysql_connect($Host, $User, $Password);
mysql_select_db($Database);
$qry = "INSERT INTO table VALUES (0 , 'こんにちは')";
echo mysql_query($qr...