₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,345,116 members, 8,515,588 topics. Date: Monday, 09 November 2026 at 08:55 AM

Toggle theme

Help Mysql Problem - Webmasters - Nairaland

Nairaland Forum › Science/Technology › Webmasters › Help Mysql Problem (686 Views)

1 Reply (Go Down)

Help Mysql Problem by Nobody: 9:36am On Jul 03, 2011
I have this code for single connection

$query = "SELECT b.*, u.nick, u.rate_sum FROM " . $DBPrefix . "bids b
LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder)
WHERE b.auction = " . $id . " ORDER BY b.bid DESC, b.quantity DESC, b.id DESC";
$result_numbids = mysql_query($query);
$system->check_mysql($result_numbids, $query, __LINE__, __FILE__); but i want to make it 2 tables et 2nd table name is users_buyers how do i add it
Re: Help Mysql Problem by Nobody: 10:05am On Jul 03, 2011
si 'et' en francais es siempre como 'and' en ingles then. . .

Are you trying to use left join for two tables or what? or you want
to split el data into dos mesas (tables)?
Re: Help Mysql Problem by Nobody: 11:55am On Jul 03, 2011
Left inner right anything that will display the other result without problems tiens
Re: Help Mysql Problem by Nobody: 12:08pm On Jul 03, 2011
Caramba! Maybe if you post a sample of the DDL and possible some Insertions someone might be able to help you do the join properly.
Joining is one serious headache i run away from except i am teaching in a class or oracle or mysql. The easiest join is still the cartesian
join, the inner joins are headaches sometimes.
Re: Help Mysql Problem by Nobody: 2:29pm On Jul 03, 2011
$query = "SELECT b.*, u.nick, u.rate_sum FROM " . $DBPrefix . "bids b
LEFT JOIN " . $DBPrefix . "users u ON (u.id = b.bidder)
WHERE b.auction = " . $id . " ORDER BY b.bid DESC, b.quantity DESC, b.id DESC";
$result_numbids = mysql_query($query);
$system->check_mysql($result_numbids, $query, __LINE__, __FILE__);

$num_bids = mysql_num_rows($result_numbids);
$i = 0;
$left = $auction_data['quantity'];
$hbidder_data = array();
while ($bidrec = mysql_fetch_assoc($result_numbids))
{
if (!isset($bidderarray[$bidrec['nick']])) {
if ($system->SETTINGS['buyerprivacy'] == 'y' && $user->user_data['id'] != $auction_data['user'] && $user->user_data['id'] != $bidrec['bidder'])
{
$bidderarray[$bidrec['nick']] = $MSG['176'] . ' ' . $bidderarraynum;
$bidderarraynum++;
}
else
{
$bidderarray[$bidrec['nick']] = $bidrec['nick'];
}
}
if ($left > 0 && !in_array($bidrec['bidder'], $hbidder_data))


iwont to add another table usersbuyers
Re: Help Mysql Problem by Nobody: 3:13pm On Jul 03, 2011
Mehn, this your question is not clear to me at all. My suggestion, take a little time out and learn how to join in mysql, it is not as hard as it is.
First, learn the different types of joins so that you will know which one will be the best and learn examples, then apply it to what you are trying
to do.
Hasta la vista. . . .
1 Reply

Please Help!!! Mysql 5.6 Not Running On My Pc. • Php/mysql Pin And Serial Number Generation Script • Wamp Server Ebook Ft Install Wamp, Write Php / Mysql / Mysql Console • 2 • 3 • 4

Dear Nairalanders • We Build And Deploy Sophisticated E.library And Supply All Kinds Of E Books • 1000 Backlinks Free