This is probably really simple... but it's been years since I've written anything, so bare with me!
I've got a MySQL database setup with a table that has multiple fields, where one is a numerical balance. I want to fetch all of these balances, add them together, and print a total.
This is what I have so far:
$acctTotal = mysql_query('SELECT bal FROM assets WHERE term = 'C'');
while($row = mysql_fetch_assoc($acctTotal)){
echo $row[bal];
}
Shuffle Array
Hi,I am writing a script for a game that needs players to randomly be assigned a target (another player) in a loop so that each player is matched with someone other than who has them. See below:Andy
preg_match logical error
Code: <?php$s = file_get_contents("page.html");preg_match('/<div class="brown_box main_ge_page vertically_spaced"><div
cURL error
So here is my code... I got it off of here... http://www.youtube.com/watch?v=XcgQUsorF_8Because I'm completely new to cURL, just wanna get a page that requires a login... I wrote everything word for
Accessing element of object array
HelloMy object looks like this:Array ( [0] => User Object ( [id] => [username] => [password] => [title] => [firstname] => [surname] => [email]
Connect to database that isn't localhost
I am currently doing a small script for a company that doesn't have mySql support on there hosting. How would I connect to the database on my hosting account? Currently I am using the following but
PHP time (deadline within one week)
I have a column ['projdue'], which stores the deadline for a project.I have PHP code and <span class>'s to show projects that are within timescale, due today and overdue:Code:
Embedding flash object in Else statement
This is my first major project in PHP and I'm having some trouble embedding a flash object in an Else statement. I've googled it several times, and looked at several sites and they all seem to
There was a problem with the request. (Code: 0)
Any Idea what could cause this? I get it randomly at best. But with both IE and FF. It derives from an AJAX banner rotation script I am attempting to implement. Well have implemented it... And the
Help! refer to a friend script with captcha code
Hi guys, I am posting on here in desperate need for some help with an ongoing search I have been doing for the last few weeks. Basically I have searched the web, high and low for a "mail to a
ASP.NET Validation Event Cycle
Hi,I have asp button as follow:<asp:Button id="btnTest" OnClientClick="SetSomething(true);" ValidationGroup="A" OnClick="btnTest_Click" />The event flow is like this,1. OnClientClick Event is