09-16-2010
Sometimes it is easier to simply read the table into an array and perform array operations after the MySQL query versus trying to do all the processing with a MySQL query.
I advise you to simplify the query, read the data into an array, and get the data you need by operating on the array, presumably in PHP.
Are you programming this in PHP?
8 More Discussions You Might Find Interesting
1. Programming
Hello,
I have three tables.
I need an SQL query (preferably Sybase) that will return all of the stringID values of table B where the following conditions exist:
(1) B.intID = A.intID
(2) B.intID != C.intID
or (B.intID = C.intID and
(C.v1 = 0 or C.v2... (2 Replies)
Discussion started by: chatieremerrill
2 Replies
2. Programming
Hi there,
I have a hierarchical database that include 4 tables. Table A is the parent of B, B is Parent of C, C is parent of D. If I want to query everything in D that is associated with A.name, how do I do that? Thanks!
YanYan (0 Replies)
Discussion started by: pinkgladiator
0 Replies
3. Web Development
hello all
i have 2 columns every column in the following format
column1
2011-04-01 11:39:54
column2
2019-02-03 00:00:00
i want get difference between above data as following
2 days 11:39
how to do so ?
i tried many functions but nothing works
please advice what is the query... (6 Replies)
Discussion started by: mogabr
6 Replies
4. Shell Programming and Scripting
A file whose location i am not aware of contains the below text
<url>jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(FAILOVER=on)(ADDRESS=(PROTOCOL=TCP)
(HOST=ngm2sn1p2-vip.mybank.net)(PORT=4001))(ADDRESS=(PROTOCOL=TCP)(HOST=ngm2sn2p2-vip.mybank.net)... (1 Reply)
Discussion started by: mohtashims
1 Replies
5. Programming
Hello
i have created mysql query to compare to values and get difference in percentage
as following:
SELECT file_name, 100 - ((100 * (SELECT file_count FROM xipi_files z WHERE x.file_group = z.file_group AND x.file_name = z.file_name AND z.insert_date = CURDATE( ) - INTERVAL 1 DAY)) /... (1 Reply)
Discussion started by: mogabr
1 Replies
6. Shell Programming and Scripting
Hi,
I wish to find the latest occurance of the below string in my log file.
Once found, I need to search the below string after the above string
and display this
Request 331489 has passed
or
Request 331489 has failed
I would like my query to be platform... (11 Replies)
Discussion started by: mohtashims
11 Replies
7. Shell Programming and Scripting
Hi,
I provide the path to a folder.
I would like so drill in each folder inside the folder i gave and show me the size in human readable form du -sh <folder-name> of the top 8 folders with maximum sizes.
For example:
Path of the folder: "/opt/app/myapp" has these directories.
ls... (2 Replies)
Discussion started by: mohtashims
2 Replies
8. Programming
Hi All,
i have a table in mysql with the following data
Table name Test
Assettype Serial_No Status location
Mouse 123456 In Stock chennai
Mouse 98765 Allocated chennai
Keyboard ... (2 Replies)
Discussion started by: venkitesh
2 Replies
MYSQLI(3) 1 MYSQLI(3)
The mysqli class
INTRODUCTION
Represents a connection between PHP and a MySQL database.
CLASS SYNOPSIS
mysqli
mysqli
Properties
o
int$mysqli->affected_rows
o
string$mysqli->client_info
o
int$mysqli->client_version
o
int$mysqli->connect_errno
o
string$mysqli->connect_error
o
int$mysqli->errno
o
array$mysqli->error_list
o
string$mysqli->error
o
int$mysqli->field_count
o
int$mysqli->client_version
o
string$mysqli->host_info
o
string$mysqli->protocol_version
o
string$mysqli->server_info
o
int$mysqli->server_version
o
string$mysqli->info
o
mixed$mysqli->insert_id
o
string$mysqli->sqlstate
o
int$mysqli->thread_id
o
int$mysqli->warning_count
Methods
o
mysqli::__construct ([string $host = ini_get("mysqli.default_host")], [string $username = ini_get("mysqli.default_user")], [string
$passwd = ini_get("mysqli.default_pw")], [string $dbname = ""], [int $port = ini_get("mysqli.default_port")], [string $socket =
ini_get("mysqli.default_socket")])
o
bool mysqli::autocommit (bool $mode)
o
bool mysqli::change_user (string $user, string $password, string $database)
o
string mysqli::character_set_name (void )
o
bool mysqli::close (void )
o
bool mysqli::commit ([int $flags], [string $name])
o
bool mysqli::debug (string $message)
o
bool mysqli::dump_debug_info (void )
o
object mysqli::get_charset (void )
o
string mysqli::get_client_info (void )
o
bool mysqli::get_connection_stats (void )
o
mysqli_warning mysqli::get_warnings (void )
o
mysqli mysqli::init (void )
o
bool mysqli::kill (int $processid)
o
bool mysqli::more_results (void )
o
bool mysqli::multi_query (string $query)
o
bool mysqli::next_result (void )
o
bool mysqli::options (int $option, mixed $value)
o
bool mysqli::ping (void )
o publicstatic int mysqli::poll (array &$read, array &$error, array &$reject, int $sec, [int $usec])
o
mysqli_stmt mysqli::prepare (string $query)
o
mixed mysqli::query (string $query, [int $resultmode = MYSQLI_STORE_RESULT])
o
bool mysqli::real_connect ([string $host], [string $username], [string $passwd], [string $dbname], [int $port], [string $socket],
[int $flags])
o
string mysqli::escape_string (string $escapestr)
o
bool mysqli::real_query (string $query)
o public mysqli_result mysqli::reap_async_query (void )
o public bool mysqli::refresh (int $options)
o
bool mysqli::rollback ([int $flags], [string $name])
o
int mysqli::rpl_query_type (string $query)
o
bool mysqli::select_db (string $dbname)
o
bool mysqli::send_query (string $query)
o
bool mysqli::set_charset (string $charset)
o
bool mysqli::set_local_infile_handler (mysqli $link, callable $read_func)
o
bool mysqli::ssl_set (string $key, string $cert, string $ca, string $capath, string $cipher)
o
string mysqli::stat (void )
o
mysqli_stmt mysqli::stmt_init (void )
o
mysqli_result mysqli::store_result ([int $option])
o
mysqli_result mysqli::use_result (void )
PHP Documentation Group MYSQLI(3)