User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,547 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,360 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 275 | Replies: 4
Reply
Join Date: Oct 2007
Posts: 2
Reputation: Shygirl is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Shygirl Shygirl is offline Offline
Newbie Poster

Question can experts pls help?

  #1  
Oct 11th, 2007
  1.  
  2.  
  3. <?php
  4.  
  5.  
  6.  
  7.  
  8. $username="151296";
  9. $password="******";
  10. $database="151296";
  11.  
  12. mysql_connect(localhost,$username,$password);
  13. @mysql_select_db($database) or die( "Unable to select database");
  14.  
  15. $last = $_COOKIE['ID_my_site'];
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. SELECT 'Wing' FROM 'users' WHERE 'username' =$last;
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. $CC1 = ['CC1'];
  35. $amount1 = $_POST['amount1'];
  36. $total = $CC1 + $amount1;
  37. $UPDATE FROM 'users' WHERE 'username' = $last SET `CC1` = 'CC1'+ '$amount1';
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. ("Location: arming.php");
  49. }
  50.  
  51. ?>
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  












i keep getting a white screen
Last edited by Shygirl : Oct 11th, 2007 at 5:09 pm.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2007
Location: Cavite,Philippines
Posts: 508
Reputation: ryan_vietnow is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 68
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: can experts pls help?

  #2  
Oct 11th, 2007
What exactly do you want to do?I cannot get your point here.
"death is the cure of all diseases..."
http://ryantetek.wordpress.com
Reply With Quote  
Join Date: Oct 2007
Posts: 2
Reputation: Shygirl is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Shygirl Shygirl is offline Offline
Newbie Poster

Re: can experts pls help?

  #3  
Oct 11th, 2007
basicly........ you have this code........






<form name="nala" action="constructX.php" method="post">


<input style="font-size:8pt;" type=submit name=cons value=Construct> 


there is more too it but its not really relavant lol






what im trying to do is update some numbers in the database.....

its saposed to look under the table "users" and see WHO that user is.... then check under his row.. what "Wing" he is in... it would be a #.... then its saposed to insert the data into THAT wing... CC1 is a field in the wings table
Reply With Quote  
Join Date: Aug 2007
Location: Cavite,Philippines
Posts: 508
Reputation: ryan_vietnow is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 68
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: can experts pls help?

  #4  
Oct 11th, 2007
$CC1 = ['CC1'];
$amount1 = $_POST['amount1'];
$total = $CC1 + $amount1;

$query="UPDATE FROM 'users' SET CC1='.$total.' WHERE 'username'= '.$last.' ";

$result=mysql_query($query);
"death is the cure of all diseases..."
http://ryantetek.wordpress.com
Reply With Quote  
Join Date: Sep 2007
Location: Budapest
Posts: 252
Reputation: fatihpiristine has a little shameless behaviour in the past 
Rep Power: 0
Solved Threads: 14
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: can experts pls help?

  #5  
Oct 11th, 2007
your sql syntax is incorrect.

change this :
("Location: arming.php");

to this
header("Location: arming.php");

whats this ? => $CC1 = ['CC1'];
did you assign any value ['CC1']; before?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 5:07 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC