ok, here we go...
I have 3 tables: posts, comments and members, i need to get title from posts, msg from comments and username from members.
all tables has an identical ID to associate(?)
for example: i want to get these data from certain ID...
sorry for my bad english, isn't my language, and my very basic skill on MySQL (started toda...
I have a next code:
$parent_priority = $data['priority'];
$where = $this->getAdapter()->quoteInto('priority >= ?', $parent_priority);
$columns = array ('id',
'title',
'enabled',
'description',
'pv',
'gv',
...
A table with about 70K records is displayed on a site, showing 50 records per page.
Pagination is done with limit offset,50 on the query, and the records can be ordered on different columns.
Browsing the latest pages (so the offset is around 60,000) makes the queries much slower than when browsing the first pages (about 10x)
Is this an...
I have a table containing data and one of the fields is 'class'
When i do:
select* from cvs where `Player ID` = <a_number>
i get data containing class numbers from 1 to 10
If i then do
select max(`Class`) from cvs where `Player ID` = <a_number>
it returns 9 and not 10?
I deleted the 10th class data and it still returned 9, i d...
I would like to be able to add my events to my mysql databse by clicking on the calendar day and inputting into a pop up window. I need to keep the fullcalendar interface but need to add to its functionality.
I have been searching extensivly for this but I keep getting side tracked or going down blind alleys.
A step by step tutorial wo...
In mySql, I have a Float field equals to 4.85
When importing into SQL Server 2008 in a Float field i get, 4,84999990463257
Someone has an idea why ?
Thanks
Jon
...
I'm writing a strategy-kind of multi user game for the web. It has a playfield (X by Y squares) that I plan on serialize and store in a BLOB in a MySQL (innodb) database, one row for each ongoing game.
I now try to figure out a good way of keeping the database updated with any changes to the playfield, and at the same time finding a c...
Hi Guys,
I am trying to create a script for quiz. I have stored current time stamp in mysql DB as quiz start time, and want to check after each quiz how much time is left.
I have the idea that I will add 30 mins to saved time stamp and subtract this value from current time. That will be the time left. But I don't know the exact way of...
Lets say I have a column of user ID's storing past login successes.
Now, I only want the most recent 20 login attempts, so Is there a way to specify the table to not store more than 20 records per user id?
...
Say if there is a table with fields
Products
--------
ID
CategoryID
Name
Price
... etc
How can Ruby on Rails give a table that returns
select count(*) from products group by categoryID
which is to show how many products in each category? How will the result be like, as opposed to Products.find(:all) which is an array of Product ...
I have the following code but it keeps presenting errors. The first part of the code creates the necessary table followed by - what should create stored procedures but it does not.
any ideas?
drop table if exists agent;
create table agent
(
agent_id int unsigned not null auto_increment primary key,
name varchar(32) not null,
commissio...
I am extracting values from a database. I am extracting a double value from a database using
ResultSet rs = ....;
while(...){
rs.getDouble("num");
}
How do I check if the value of rs.getDouble("num") is a null. Since the value is stored as a (MySQL) double and I want to store it in my JVM as a double, I can't simply use !=null.
Wh...
I have two tables: members and renewals
The two tables have a field called memberid which links the two data tables together. I am trying to construct a query which will extract the firstname and surname from the members table for the data that is being held in the renewals table. I have tried using the query below which is based on s...
I am trying to find a way to get a random selection from a large dataset.
We expect the set to grow to ~500K records, so it is important to find a way that keeps performing well while the set grows.
I tried a technique from: http://forums.mysql.com/read.php?24,163940,262235#msg-262235 But it's not exactly random and it doesn't play w...
The goal is to have a PHP script with a certain section of the code that can only be executed by one thread/process at a time.
Some restrictions:
semaphores not available on my system
The manual mentions that flock() cannot be relied on in multi-threaded servers, so flock() is out. (confirmed this)
So thought it would be possible (w...
I have a table which have an integer coloumn. Let table name is Table1 and ColName is Col1.
I want to add number 15 to every value in col1. what will be the sql query for this.
...
I have a database that has multiple scripts/sites interacting with it in terms of updating/inserting new data.
Since there is not one interface for doing this, I would like to some how track what is happening on a daily basis in MySQL.
What kinds of built in features does MySQL have for tracking changes?
For example:
An update comm...
Hi. How do I find mysql_num_rows for an object.
This gives an error:
$query = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_object($query);
echo mysql_num_rows( $row );
Warning: mysql_num_rows() expects
parameter 1 to be resource, object
given
...
I want to update a Column in a Table, based on the minimum of another column of the same table.
eg.
JobPositonId | JobPositonName | JobDescriptionId | ContactId
1 | 1 | 1 | 1
2 | 1 | 1 | 0
3 | 1 | 1 | 0
I want to updat...
I am trying to understand the difference between mysqli's query() and prepare(). I have code like below, and I would like to get the same results from both. However the prepare() does not work as expected. why?
// this works
if ($query = $this->db->query("SELECT html FROM static_pages WHERE page = 'cities'")) {
$result = ...