Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Help With Php/mysql
tdktank59
post Nov 3 2006, 07:38 AM
Post #1


Super Member
*********

Group: Members
Posts: 398
Joined: 21-June 05
From: Callifornia
Member No.: 8,519



Hey im working on a scrip that charges a "cartel" for being at war with another "cartel" and i cant seem to get this to work just right...

heres what i have so far

CODE

$cartel = mysql_query("SELECT drugringID FROM drugringwars WHERE drugringID = {$declarer['warDECLARER']} ");
while ($ids = mysql_fetch_array($cartel))
    {
    echo "cartel {$ids['drugringID']} has been charged for being at war with another cartel";
    $cost = 1000000 * (rand(1,10));
    mysql_query("UPDATE drugrings SET drugringdough=drugringdough-{$cost} WHERE drugringID={$ids['drugringID']}  ");
    echo "</br>";
    
    }


and these few things may help a bit when trying to help me...
the stuff in the while {} works fine just cant get an id from the db so heres a few things

drugrings:
IPB Image

drugringwars:
IPB Image

Go to the top of the page
 
+Quote Post
hts
post Nov 3 2006, 02:02 PM
Post #2


Advanced Member
*******

Group: Members
Posts: 138
Joined: 30-September 06
From: Iasi, Romania
Member No.: 30,851



QUOTE

$cartel = mysql_query("SELECT drugringID FROM drugringwars WHERE drugringID = {$declarer['warDECLARER']} ");


what is the point of getting the value of a mysql field which you already know?
Go to the top of the page
 
+Quote Post
tdktank59
post Nov 3 2006, 03:06 PM
Post #3


Super Member
*********

Group: Members
Posts: 398
Joined: 21-June 05
From: Callifornia
Member No.: 8,519



yeah i know lol i cant figure out what to do... i just kept messing with the code till i normaly get it to work...
Go to the top of the page
 
+Quote Post
tdktank59
post Nov 4 2006, 01:06 AM
Post #4


Super Member
*********

Group: Members
Posts: 398
Joined: 21-June 05
From: Callifornia
Member No.: 8,519



found the problem thanks for those who tried to help me
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Need Advice On Setting Up Mysql Database.(4)
  2. Quick Question(10)
  3. Mysql Database Size(7)
  4. Mysql Hacks(1)
  5. Import From Excel File Into Mysql Database(11)
  6. Creating A Php Login System Using Mysql(10)
  7. Mysql Database Not Working(3)
  8. Mysql Database Setup : Setting Up Mysql Database(6)
  9. The Only Reason I Choose Ms Sql Server Rather Than Mysql(0)
  10. Mysql Db Is Down Getting Following Error(2)
  11. Subquery In Mysql(5)
  12. It Went Well For A While(5)
  13. Increment A Mysql Column(7)
  14. Complete Login System(57)
  15. Mysql, Php, Apache Downloads And Setup Was A Nightmare(10)
  1. Qupis : Free Hosting With Php, Mysql, Cpanel. (one Line Text Ad At Bottom)(41)
  2. Database With Mysql++(7)
  3. Html Form!(4)
  4. Mysql Won't Update(4)
  5. How Do I Find My Mysql Password? [resolved](5)
  6. Mysql-essential-5.0.51 Installion Problem(2)
  7. Please Explain Me Mysql(4)
  8. Remote Access Mysql(8)
  9. Is It Possible To Access The Mysql Remotely?(10)
  10. Check Referrer To Prevent Linking Yours From Other Sites(8)
  11. Create Table - Mysql Code - Help(1)
  12. Tools Needed!(9)
  13. Mysql(2)
  14. Mysql Error(3)
  15. Mysql + Php Question(5)


 



- Lo-Fi Version Time is now: 12th October 2008 - 03:10 AM