Search found 8 matches

by patrick24
Sat May 19, 2007 5:08 pm
Forum: Databases
Topic: Writing variables to table?
Replies: 13
Views: 1157

Ah yes! I used $query = "SELECT balance FROM $customer ORDER BY ts DESC LIMIT 1"; and that worked! Thanks califdon and bdlang for all your help! You guys rock! :D
by patrick24
Sat May 19, 2007 3:42 pm
Forum: Databases
Topic: Writing variables to table?
Replies: 13
Views: 1157

Ok califdon, I think I get what your saying. This is my code: $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!"); mysql_select_db($db) or die ("Unable to select database!"); $query = "SELECT balance FROM $customer WHERE id=(SELECT MAX(id))"; ...
by patrick24
Sat May 19, 2007 12:10 am
Forum: Databases
Topic: Writing variables to table?
Replies: 13
Views: 1157

$result= mysql_query($query) OR die( 'Error in query:<br />' .$query. '<br />' .mysql_error() ); $lastbalance = mysql_result($result, 5); $balance = $lastbalance - ($price + $credit); Ok, I cleared the table and now I get the error: mysql_result() [function.mysql-result]: Unable to jump to row 5 on...
by patrick24
Fri May 18, 2007 11:54 pm
Forum: Databases
Topic: Writing variables to table?
Replies: 13
Views: 1157

Ok, that helped a bunch, and I thought it was working but now $lastbalance is 1.25 ?!?
Just a sec, I'm trying to figure what I'm doing here...
by patrick24
Fri May 18, 2007 7:52 pm
Forum: Databases
Topic: Writing variables to table?
Replies: 13
Views: 1157

Thanks, bdlang. Maybe a little frustrasted at times but not discouraged. :) I've only started learning php since this monday so I think I'm doing good for a noob, I can just get carried away sometimes lol. So for now I'm pulling my self back and learning more basic stuff, but I still haven't given u...
by patrick24
Thu May 17, 2007 10:00 pm
Forum: Databases
Topic: Writing variables to table?
Replies: 13
Views: 1157

Thanks for your help bdlang. Yes, I don't really know what I'm doing, so I'll do some of that reading. Also I think I need to get use to more basic stuff before tackling what I'm trying to do. I just had an idea, and I thought I could pull it off without really knowing what to do, but I guess there'...
by patrick24
Thu May 17, 2007 8:30 pm
Forum: Databases
Topic: Writing variables to table?
Replies: 13
Views: 1157

feyd | Please use , and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color] Thanks fo...
by patrick24
Thu May 17, 2007 7:24 pm
Forum: Databases
Topic: Writing variables to table?
Replies: 13
Views: 1157

Writing variables to table?

Hi, I'm new to php, and I've been doing online tutorials/manuals to try and understand how to use it. So, I'm just beginning to get a grip on basic php. I've finally figured out how to start using a database and creating tables. I know how to input form data into a table, but I can't seem to figure ...