biometrics
Honorary Master
- Joined
- Aug 7, 2003
- Messages
- 71,858
Do you need historical data? If not rather do updates than inserts.
Do you need historical data? If not rather do updates than inserts.
On my phone but something like:
update stock_prices set price=123 where company='abc'

echo "<div class=\"stock"; if ($percentage >= 0) {echo ' green';} else { echo ' red';} echo "\" id=\"stock-1\">
<span class=\"symbol\">$company</span>
<span class=\"change\">";if ($percentage > 0) {echo '+';} else { echo '';} ;
echo $percentage;echo "%</span>";
echo "<br>";
echo "<span class=\"price\">$price cents</span>";
echo "</div>";
//Select Stocks to shpw
$sql = "SELECT company, price, percentage FROM stock_history";
$statement = $db->prepare($sql);
$statement->execute();
(
[company] => Taste
[price] => 230
[percentage] => 2
)
I normally use mysqli not pdo
Never heard of this PDO thing. But I use a framework.
Well whatever db link you use not so important. We use php-fpm on nginx and mysqli. We have 128Gb servers from DigitalOcean and runs smoothly.
It's got electrolytes.Not bothered about this, this side chat is not?
I mean weather I use PDO, mysqli procedural or mysqli oo should make a difference to my end result should it?
Maybe I don't grasp the differences.
Please enlighten me with pros and cons
As I am learning along the way
CoreShares Top 50 0%
2098 cents
Taste Holdings Ltd +2%
230 cents
Shoprite Holdings Ltd 0%
20598 cents
Capital & Counties Properties PLC 0%
5010 cents
Coronation Fund Managers Ltd +1%
7482 cents
db x-trackers - MSCI WORLD INDEX ETF -2%
2328 cents
EOH Holdings Ltd 0%
14310 cents
JSE Ltd -2%
17200 cents
[B]Time: 0.0029 Seconds[/B]
1 vs 12I normally use mysqli not pdo
Importance to debugging vital; importance to user inconsequential; its really about consumption timeYou guys are amazing!
The initial script did 5 seconds.
By having that as a background process via cron and the view as a separate read from the db process we have now achieved this:
Code:CoreShares Top 50 0% 2098 cents Taste Holdings Ltd +2% 230 cents Shoprite Holdings Ltd 0% 20598 cents Capital & Counties Properties PLC 0% 5010 cents Coronation Fund Managers Ltd +1% 7482 cents db x-trackers - MSCI WORLD INDEX ETF -2% 2328 cents EOH Holdings Ltd 0% 14310 cents JSE Ltd -2% 17200 cents [B]Time: 0.0029 Seconds[/B]
Now I am no expert, but 0.0029 seconds load time seems pretty acceptable to me?