Hi, I'd like to know if it is possible to create a prepared statement with PHP and MySQL using the mysql library rather than the mysqli library.
I can't find anything on the PHP documentation.
Thanks.
...
When I call mysql_fetch_row() or mysql_fetch_array(), any column that is NULL is not in the returned array.
Is this a feature?
Context:
I am using CakePHP to get data using Model::find().
EDIT
The issue is that when I use the SQL statement:
SELECT col_1, col_2 FROM table where col_1 is defined as VARCHAR NOT NULL and col_2 as VARC...
Suppose I have a page called mysql_query_performance.php which contains code to select some records from table and echo it.
But I want to know how can I simulate more than 1 request to test the performance of that query?
Is this Possible? If yes, How?
...
Hi,
I'm doing some mysql server management with a script that flushes the MySQL users privileges when new privileges are added to a MySQL user.
I'm using the PDO class to do my queries, but when I do a simple
FLUSH PRIVILEGES;
I get, for
$connection->exec('FLUSH PRIVILEGES;');
and
$connection->query('FLUSH PRIVILEGES;');
S...
For each table in my MySQL database I have a mytablename.sql file which contains the CREATE TABLE statement for that table.
I want to add a test to check that noone has added/altered a column in the live database without updating this file - that it, I want to check that I can re-create an empty database using these scripts.
How can I ...
I tried below code
$sql=mysql_query("SELECT * FROM `user`");
$result=mysql_result($sql, 6);
echo $result;
It returns the value of first field of 7th row. But Its works fine till 9th row. And after that it returns again from 1 . So anyone please help .. how I can get value of n-th row from mysql.
Thanking You.
[email protected]...
I cant seem to get these Chinese punctuation marks to work with my database (utf-8)
when i do an echo of the query the marks look like this
���
in php i have already done
$text=mysql_real_escape_string(htmlentities($text));
so as a result they are not saved into the database correctly what can i do to fix this?
Thanks
...
Background:
I have a cclassifieds website, and users may for example search for cars, and specify a price range, mileage, fueltype, gearbox and a manually inputted query-string if they like to put something specific into the search, ex "bmw m3".
Questions:
I am about to move this information to Solr for faster lookup, and wonder if I ...
I'm developing an application tha uses seven datasources (ds) for MySql databases. I'm pretty satisfied with the result when it is working. However i'm getting are datasource related problems when I redeploy my aplication.
Here is one of the seven ds I've configured in my my-application-ds.xml:
<xa-datasource>
<jndi-name>jd...
I'm trying to group by date of birth and count based on the results, using CakePHP. Here's my query.
$data = $this->User->find('all', array(
'fields' => array(
"DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(User.dob, '%Y') - (DATE_FORMAT(NOW(), '00-%m-%d') < DATE_FORMAT(User.dob, '00-%m-%d')) AS age",
'COUNT(id)'
),
...
How can I connect to MySQL db and execute queries ?
...
Hello,
I use a SELECT to get all the rows from the table tblnavigation.
The rows are: idnav, idnavcat, prognav, progurl
$rsnav = mysql_query($query_rsnav, $concat) or die(mysql_error());
$row_rsnav = mysql_fetch_assoc($rsnav);
The idnavcat stands for the navigation category. Now i want to filter on that "idnavcat"; and show the resul...
I have a table filled with URLs. The URLs are in all sorts of formats: http://foo.com, http://bar.foo.com, http://foo.com/bar, etc. But I'm only interested in the domain name itself, so in this case: foo.com. What I'd like to do is select how many times domain names exists in this table. So something like:
SELECT "whatever the domain is...
Hi,
I am unable to connect the two. Mainly I can't get the rake function to work. Can anyone offer suggestions?
...
I am using Propel (1.4) with Symfony 1.31 (with mySQL db).
I want to save save/retriev BLOB (gzipped) data to/from the database
My db schema is defined in YML.
Suppose the schema looks like this:
demo_blobbed_object:
_attributes: { phpName: MrBlobby }
id:
name: {type: varchar(32)}
data: {type: ? }
I have the following questi...
I'm storing linked lists of data in records that look like this:
CREATE TABLE IF NOT EXISTS `data_nodes` (
`record_id` int(11) NOT NULL,
`prev_node` int(11) NOT NULL,
`data` varchar(200) NOT NULL,
PRIMARY KEY (`record_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
where prev_node is the record_id of the previous item in the list,...
I have written a query to Select sales values from a database and apply discounts if there were any used. The discounts are either a percentage or just a flat-value. My Query applies the discounts (first case statement) and then pulls the amount that was applied.
It got me thinking if it was possible to get this done in one case state...
On a page which shows a specific object I need to display related objects for that object based on tags. ´The object with the most matching tags should be at the top. Basically I somhow need to identify how many tags for each object that match the object on the page and display the top results.
My db schema:
Table Object
------------
...
I apologize up front for the broadness of this question, but I'm wondering if anyone has any suggestions/pointers.
A friend's company uses SPSS for statistical data, surveys, etc. They'd like to be able to slice and dice the the info via a web interface. I have no knowledge of SPSS, so there may be a simple web front end, but being a PH...
I know it's possible, but I'm not experienced enough to know how to do subqueries.
Here's the situation:
Table 1:
+--------------------+--------------------+
| v_id | v_name |
+--------------------+--------------------+
| 1 | v_name1 |
+--------------------+--------------------+
| et...