» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 76
0 members and 76 guests
No Members online
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
Web Hosting - web hosting, dedicated servers and web design services
Online Degree - search for 1000+ online degrees, online colleges & online universities.
tattoo - we are a group of tattoo enthusiasts
Gexa Energy - your absolute best choice in electric service
Texas electricity - save on electric rates
Rimonabant - combat obesity and smoking at the same time
Football Betting - best nfl betting promotions at sportsbook.com.
Poker Chips - Clay and composite poker chips for home games.

Register Now! Contact Us

About this Page
This is a discussion on Need help with PHP/MYSQL within the Site design forums, part of the General category; I am having a problem getting php to change mysql database values. It can query the database fine but it ...



Go Back   Nukemods Forum » General » Site design

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-17-2004, 05:07 PM
Junior Member
 
Join Date: Aug 2004
Posts: 2
Need help with PHP/MYSQL
I am having a problem getting php to change mysql database values. It can query the database fine but it won't change the database. What am I doing wrong?

I have tried many different methods of sql= UPDATE ****** none of which work including the sql = "UPDATE nuke_users SET user_sig = 2 WHERE username= '/Akadios/'";

That MySQL administrator Welcome to phpMyAdmin 2.5.3 told me to put in simply to change usersig to 2 (note that the script UPDATE nuke_users SET user_sig='2' WHERE username = 'Akadios' directly put into MySQL functions correctly and when asked to make php code phpMyAdmin makes the code I tried which doesn't Anyways I have included all the SQL related code and left out other parts.


Code:
<?php ?>
<html>
<head><title>PHPBB Signature Generator by vanurangers.com</title></head>
<body>
<center>
<h3>PHPBB Signature Generator</h3>
</center><left>


vanurangers.com &copy; 2004




<?php
//var name parsing

$username = $_GET['username'];
$password = $_GET['password'];

$new_pass = md5($password);
$host = "localhost";
$dbusername = "********";
$dbpassword = "********";
$database = "vanurangers_com_-_phpnuke";
$server = mysql_connect($host, $dbusername, $dbpassword) or die(mysql_error());
$connection = mysql_select_db($database, $server);

$sql = "SELECT user_password FROM nuke_users WHERE username = '$username'";
          $result = (mysql_query($sql));

$storedpass= (mysql_result($result, 0));
        if ( $storedpass != $new_pass)
                 {
                          echo "incorrect password";
                          exit;
                  }            else

//rest of code here that fills $signature which is what I
// eventually when it works to go into the signature. (replacing all the old
//data in the user_sig.

<?
sql = "UPDATE nuke_users SET user_sig = 2 WHERE username= '/Akadios/'";

 mysql_close($server);
?>
</html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-18-2004, 01:25 AM
Moderator
 
Join Date: Nov 2002
Location: Belgium
Posts: 957
replace this
Code:
sql = "UPDATE nuke_users SET user_sig = 2 WHERE username= '/Akadios/'";
with this
Code:
$sql = "UPDATE nuke_users SET user_sig = 2 WHERE username= 'Akadios'";
mysql_query($sql);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-19-2004, 10:44 AM
Junior Member
 
Join Date: Aug 2004
Posts: 2
Thank you that worked 8)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UserId Maxed out in MySQL Kilch Open topics 0 03-10-2006 11:59 AM
There seems to be a problem with the MySQL server, sorry for unno Nuke 7.x - General 8 03-09-2006 03:34 PM
Mysql connect problem Killalla Nuke 6.5 to 6.9 - General 0 10-29-2005 11:41 AM
Upgrade Issues on MySQL liliputt Nuke 7.x - General 2 06-22-2005 05:52 AM
I really need help with PHP and MySQL jasonmkiggy Site design 4 10-01-2004 01:19 PM


All times are GMT -5. The time now is 12:03 PM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31