Mysql Won't Update

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Mysql Won't Update

ZPGames
Ok, so I'm making some arcade administration software so I don't have to add games the hard way, well anyway, one of the features I have is that on the homepage is a featured author and as such I just have it so it updates one line in the mySQL. Well, the page with the form passes on the varibles fine and the updating page recieves them because I echoed everything, then I build the query and I even echo the query and it comes out exactly how I want it to, but for some reason, the database itself won't update even though all the varibles are there.

Here's my update page

CODE
<?php
$ud_author=$_POST['ud_author'];
$ud_authorwebsite=$_POST['ud_authorwebsite'];
$ud_description=$_POST['ud_description'];

echo "$ud_author <br><br>";
echo "$ud_authorwebsite <br><br>";
echo "$ud_description <br><br>";


$username="dbusername";
$password="password";
$database="datbasename";
mysql_connect(localhost,$username,$password);


$query="UPDATE featuredauthor SET author='$ud_author', authorwebsite='$ud_authorwebsite', description='$ud_description' WHERE id='1'";
mysql_query($query);
echo "$query <br><br>";
echo "Record Updated <br><br>";
mysql_close();
echo "<a href='http://www.zpgamez.com/games/admin/?p=featuredauthor'>Back</a>"
?>


Any help, I would greatly appreciated.

Thanks

 

 

 


Reply

truefusion
I believe you're missing one important line of code:
CODE
mysql_select_db($database);

If you don't select which database to use, then it's not going to work the way you intended it to work.

Reply

ZPGames
Thank you so much, I can't believe I forgot such a silly, but important thing.

Reply

iGuest
Updation Problem in MySQL
Mysql Won\'t Update

I have a problem in MySQL. When more than one client update same table as the same time,it won't work. So, how do I make out for it? example:In real-time application, one of my client updating same table and same column and at the same time one of my other client also updating the same table and same column, but only one updation is allowed and the other wont work. Can you solve this and let me know?

-question by Karthik

Reply

optiplex
Hmm

I think u forgot to select the DB.

And you see, on this line 'mysql_connect(localhost,$username,$password);'
I think you should type localhost between quotes, like this "localhost", or "127.0.0.1"

And after that , select db
mysql_select_db($database);

And for the update query
if(mysql_query("UPDATE table SET column = 'lolz' WHERE id = '17'")){
echo "updated!";
} else {
echo "something went wrong sad.gif";
}

@ Trap_FeedBacker:

I dont think you can fix that, at least dont know how, im sorry.
I dont see the problem if multiple queries are being submitted at one time, that shouldnt be a problem
for mysql.

- optiplex

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. how to update rows hourly mysql - 209.43 hr back. (1)
Similar Topics

Keywords : mysql, update

  1. [ Aef ] Security Update For Aef Forum Software
    Highly recommended (1)
  2. Mysql Hacks
    (1)
    There are MySQL hacks out there, They can travel from your website to your computers. One of these
    are the MySQL injectors. The injection drops your tables and shuts down the program permanently. Be
    careful of these hacks, as they can destroy your MySQL related websites, programs, etc.....
  3. Creating A Php Login System Using Mysql
    I need help in creating a login system, what I want is a login system (10)
    Hey everyone! I am helping someone make a login system using MySQL databases and a PHP login
    form. I have a fair bit of experiance in HTML and some javascript too. I have virtually no
    experiance in MySQL or PHP. Anybody know of any good PHP login systems that allow you to creat a
    personalised page for each user and when they login the system transfers the user to their page.
    Another thing that the system MUST have is a way of stopping unwanted users entering someones page.
    CODE For example lets say I register and my UN is jesse123 and my personalised pages a....
  4. Mysql Database Not Working
    (3)
    well i'm getting an error message(a databass connection warning) for all of the parts of my site
    that connects to a mysql database i check my database users pertmissions and i try to do the repair
    database thing and it's still not woeking. am i the only person having this or is it an overall
    trap17 issue and how do i fix it.....
  5. The Only Reason I Choose Ms Sql Server Rather Than Mysql
    (0)
    The only reason i choose ms sql server rather than mysql is, MS SQL has more security
    features!! MySQL is lacking a lot in my opinions - Lack in wide char, like nvarchar, I
    developed some application to support chinese letter, and dont know how to build one in mysql - Lack
    in t-sql syntax, like query in query is not fully supported - Does not have today SQL features like
    BI support (today really required) And compare MS SQL to MySQL, the only reason why mysql is
    favourable is - it is free! Dont u guys agree?....
  6. Need Advice On Setting Up Mysql Database.
    I have a huge amount of daily data updates to be inserted. (4)
    First of all, to get the idea of what I am trying to achieve here, please have a look at my
    idea thread, entitled Idea For Using A Cron Job To Grab Daily Travian Map.sql Updates . This gives
    a prelude to the project, what it is for, what it is supposed to do, etc. Now, what I need is
    specific advice on setting up the mySQL database(s) to implement this idea. There is a useful FAQ
    file for how to make use of the map.sql data located on the help.travian.com website, which also
    gives an example of the CREATE TABLE instruction that matches the data in the map.sql fi....
  7. Mysql Db Is Down Getting Following Error
    (2)
    My Mysql is Down can I get some help please? Appreciate it. Patrick Domain: patrickcurl.com Error:
    phpMyAdmin - Error #2002 - The server is not responding (or the local MySQL server's socket is
    not correctly configured)....
  8. It Went Well For A While
    MySQL problem back in all its glory. (5)
    Some time ago I had a stubborn problem when trying to access one of the interactive pages on my
    website and getting the following error: QUOTE Warning: fopen() : open_basedir restriction in
    effect. File(include/errors.xml) is not within the allowed path(s):
    (/home/mrdee:/usr/lib/php:/usr/local/lib/php:/tmp) in
    /home/mrdee/public_html/admin/include/commonfunctions.php on line 682 Warning:
    fopen(include/errors.xml) : failed to open stream: Operation not permitted in
    /home/mrdee/public_html/admin/include/commonfunctions.php on line 682 Cannot open XML data file:
    incl....
  9. Garden Update
    Anybody need any Zucchinni?????? (0)
    Well, at least those things are doing good! Before too much longer our friends will not be
    picking up the phone when we call (if they have caller ID) and will lock the doors if they see us
    comming and pretend not to be home. I can hardly walk threw the kitchen right now, we have a huge
    pile in bags sitting on the floor. And the most upsetting thing so far, I can't find an old
    recipe I used to have to make spiced apple rings out of them. Things are not coming out right, we
    need to defrost our deep freeze, and need more time to use up some of the stuff, but ha....
  10. How Do I Find My Mysql Password? [resolved]
    Cannot access my MySQL (5)
    After all the recent problems, my account has been restored. I have setup my parked domain agin, and
    that works fine. However, I can no longer access my MySQL databases (I can from PHPMyAdmin, but
    that's all). I had to create a new user for my databases, and created the user with exactly the
    same username and password I had before, but some of my web pages do not let me access the pages I
    have associated with my databases. Where could i find out what my DB password is? (Although I am as
    good as sure I am using the right one). I have tried my old password, the new c....
  11. Please Explain Me Mysql
    How do i insert information into this config: (4)
    Hi, I wanted to try just to test how can i connect my website to another mysql server, but i have no
    idea how to insert the other mysql information such as port and host etc.... so here is the config
    file please give me an example CODE <?php // mySQL information $server =
    'FRESHSQL.COM:3306';                   // MySql server $username =
    'vasilevich';                      // MySql Username $password =
    '*******';                         // MySql Password $database =
    'vasilevich';                  // MySql Da....
  12. Remote Access Mysql
    (8)
    Is it possible to directly access my local database from my website? For example, if somebody
    submits info on my website, the info they submitted would be transferred to my local database
    directly. Is that possible? And if so, how do I set that up? The reason I don't want to upload
    my database to my subdomain is because it would be difficult to keep the website database and my
    local database in sync . . . or is there a way to do that? Thanks for any replies.....
  13. My Spy Suggestions For Team Fortress 2 Next Update S
    Spy is my favorite class and I think these suggestions own (10)
    I thought about this and I like it. You may disagree or agree or may like 1 or 2, but still read it
    and tell me what you think. Spy --- Sapper Replacement Electronic Canceler: -------------------
    At a limited distance away, you must look at the sentry, teleporter, or dispenser and you can use
    your electronic canceler. It will freeze the sentry, dispenser, or teleporter for an X amount of
    seconds (I suggest 10) and once it is over, the engineer's building unfreezes. Engineer can
    still repair Now valve can do whatever they want with this but, I like this: You c....
  14. Sending E-mails After News Update?
    Coding needed?!? (8)
    I need the following code or the idea how to reach this concept. Let's say, I have a database
    entry which is called "news", where all of the news stories are stored. If this database entry got
    modified, like the new post was added to the web-site by an administrator, the registered users will
    get some kind of email notification automatically, I mean the mails are sent automatically without
    the interaction of someone else. ....
  15. Html Form!
    Using MySQL?! (4)
    Hey, I need your help again! I need some good working tutorial how I can update my SQL through
    HTML form. I did use some tutorials online found with the help of google; but they do not work
    properly; I mean there are still small mistakes. I need to have a good tutorial to follow. It
    should be based on security and more things. It has to be done in proper way.......
  16. Mysql, Php, Apache Downloads And Setup Was A Nightmare
    Mysql, PHP, Apache (10)
    Mysql, PHP, Apache downloads were easy enough. Then came the setup process. This seemed to be an
    endless mess of going back and forth trying to get the programs to work together properly. Finaly I
    got them working after about 48 hours. There are great tutorials on the setup process, but only one
    or two actualy were easy enough for me to understand. I would like to see if I was the only one who
    had issues with this setup. Are there easier ways to setup the three?....
  17. Mysql-essential-5.0.51 Installion Problem
    please help me.(urgent) (2)
    Dear friend, please help me. Iam working on php project (matchmaking site). I have downloaded mysql
    essensial 5.0.51. When i was installing mysql 5.0.51, i got following error - Error 1901: Error
    attempting to read from the source installation database:
    c:\windows\installer\527ec6.msi What is solution of this problem ? Iam using
    windows xp professional version 2002 (service pack 2). Please post your reply. Iam waiting for your
    answer. ....
  18. Database With Mysql++
    getting mySQL++ to work with trap17 (7)
    Hi, I'm trying to build an online game and figured the easiest way to do the server list would
    be to make a mySQL database for it; however, I use the con() command on the IP i get from pinging my
    website and I always get an abnormal program termination; however, it will work with the mySQL on my
    own machine. The code is below: CODE #include <iostream> #include <iomanip>
    #include <mysql++> #include "pass.h"//holds my password (i program at
    school) int main(void) {     Connection con("t3jem3_test","....
  19. Runescape Update
    runescape pking update (4)
    my name is m spartan w and i personally dont like the new update abought pking and bounty i got some
    resons ferst becuse im a pker thats how i make my money and staking but jagex messed it up i have
    no money makeing ways my skills arnet that high so what im asking is that we make suggestions jagex
    saide that they will not change the update but if we can give them our ideas that it might help
    heres my idea that we make a command like a script that tells can tell if your a gold seller that
    you can only have pking items u must not have multiple furys as you can sell tho....
  20. Qupis : Free Hosting With Php, Mysql, Cpanel. (one Line Text Ad At Bottom)
    a member of Xisto (41)
    Hello Members, We are proud to introduce a new member to Xisto group of sites.
    Qupis : Free Web Hosting 150 MB space, 5000 MB Bandwidth, php,
    mysql, CPanel (Latest). Emails, FTP, Addon domains, Parked Domains etc.
    http://www.Qupis.com
    Feel free to add your reviews and comments about it. -Trap17
    Management ....
  21. Is It Possible To Access The Mysql Remotely?
    (10)
    I like to experiment with a lot of things and I was thinking of making a sort of instant messenger
    in Python, but I want to let people have actual accounts so I need to be able to access the mySQL
    remotely. If that's not possible, are we allowed to run Python scripts on the server?....
  22. Check Referrer To Prevent Linking Yours From Other Sites
    Check referrer with Php and Mysql (8)
    Check Referrer Using Php To Prevent People Linking To Your Downloads From Other Sites Ever
    find that found some people are listing items, images and tuts and linking directly to the download
    url (those that are like my photoshop tutorial.php?id=0), which is a .php to count the number of
    downloads. To prevent this, you can add a piece of code to the download pages that checks which page
    referred them to the download page: if it's my domain, it downloads the file normally, if
    it's not, it will redirect to my home page instead. Important : Not all browser....
  23. Quick Question
    Is there a limit on the size of the MySQL database? (10)
    Question's in the title!....
  24. Subquery In Mysql
    (5)
    Is there anyway to make subqueries work in MySQL? I'm pretty certain someone out there knows
    how. /smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /> Can anyone help?
    CODE Select * from ITEMS where ID="Select Max(ID) from ORDERS"; This works
    for MSAccess and SQL Server but why not in MySQL? I'll be writing some reports and I've
    shifted database from MSAccess to MySQL. Help! Thanks.....
  25. Mysql Database Size
    related to the free database space (7)
    hi all! this is my first post /biggrin.gif' border='0' style='vertical-align:middle'
    alt='biggrin.gif' /> and i have a doubt, how much mysql space i am allowed to use... i mean how
    much is available for my free account....
  26. Problem Installing Sims 2 Nightlife
    update failure (26)
    I have the Sims 2. I tried to install Sims 2 Nightlife expansionpack. He reches 100 % with
    installing the game...then he automatically run the updat for the sims 2. But when he's going
    trough the files he stops st the file: CSBin/package.exe He says there is a error, and then when I
    click ok, install terminates and goes back from 100% to 0%. Can anybody tell me what's going
    wrong here? Has anyone else had this problem? I just can't figure it out. And on the internet I
    found a few people who had the same problem but just havent had an solution for it yet. Ca....
  27. Import From Excel File Into Mysql Database
    (11)
    Has anyone tried using the excel import function that comes with phpmyadmin
    http://www.phpmyadmin.net/home_page/ - it does not require any additional plug-ins or scripts and
    is fairly straightforward to use. In phpmyadmin, if you click on the database table which you wish
    to import the data to , there is a link on the bottom left corner which says "insert data from a
    text file into the table" - although it says text file it still can be used to import an excel file.
    When you click on this link you will be taken to a page where you will be asked for the file name
    (the....
  28. Increment A Mysql Column
    how to increment a MySQL column one unit (7)
    Hi, I have a column in a MySQL table which contains a counter of the views of the object described
    by this table. I would like to increment this value by one everytime the object is viewed. Obviously
    came into my mind the possibility of retrieving the value of this field, store it in a variable
    increment this value by one and perform an UPDATE query again with this new value. My question is if
    there is a MySQL option to update the field with its actual value plus an unit increment. I hope you
    understand the issue.....
  29. Complete Login System
    With PHP + MYSQL (57)
    Its an complete login sistem made and tested by me and I think itwill be very usefull for people who
    are tryn to learn PHP. First, let's make register.php: CODE <?
    include("conn.php"); // create a file with all the database connections
    if($do_register){ // if the submit button were clicked if((!$name)
    || (!$email) || (!$age) || (!$login) ||
    (!$password) || (!$password2)){ print "You can't let
    any fields in blank....
  30. Mysql Database Setup : Setting Up Mysql Database
    Guide to use MySQL database in your site (6)
    A SMALL INTRODUCTION TO DATABASE ============================= I have seen that many members have
    problems with Database. Here is a small INFO which should give you the IDEA. mySQL is a DATABASE
    server. You can access it using the link in Cpanel. Cpanel can be accessed by
    "www.YOUR-SITE.com/Cpanel" There you have 4 Main Options :- 1> CREATE A DATABASE 2> CREATE A USER
    3> ADD USER TO DATABASE 4> PHPMYADMIN CREATE : IT ALLOWS YOU TO CREATE A DATABASE CREATE USER
    : IT ALLOWS YOU TO CREATE A USER. USING THIS, YOU CAN ACCESS THE DATABASE. A DATABASE CANNOT BE....

    1. Looking for mysql, update

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for mysql, update

*MORE FROM TRAP17.COM*
Similar
[ Aef ] Security Update For Aef Forum Software - Highly recommended
Mysql Hacks
Creating A Php Login System Using Mysql - I need help in creating a login system, what I want is a login system
Mysql Database Not Working
The Only Reason I Choose Ms Sql Server Rather Than Mysql
Need Advice On Setting Up Mysql Database. - I have a huge amount of daily data updates to be inserted.
Mysql Db Is Down Getting Following Error
It Went Well For A While - MySQL problem back in all its glory.
Garden Update - Anybody need any Zucchinni??????
How Do I Find My Mysql Password? [resolved] - Cannot access my MySQL
Please Explain Me Mysql - How do i insert information into this config:
Remote Access Mysql
My Spy Suggestions For Team Fortress 2 Next Update S - Spy is my favorite class and I think these suggestions own
Sending E-mails After News Update? - Coding needed?!?
Html Form! - Using MySQL?!
Mysql, Php, Apache Downloads And Setup Was A Nightmare - Mysql, PHP, Apache
Mysql-essential-5.0.51 Installion Problem - please help me.(urgent)
Database With Mysql++ - getting mySQL++ to work with trap17
Runescape Update - runescape pking update
Qupis : Free Hosting With Php, Mysql, Cpanel. (one Line Text Ad At Bottom) - a member of Xisto
Is It Possible To Access The Mysql Remotely?
Check Referrer To Prevent Linking Yours From Other Sites - Check referrer with Php and Mysql
Quick Question - Is there a limit on the size of the MySQL database?
Subquery In Mysql
Mysql Database Size - related to the free database space
Problem Installing Sims 2 Nightlife - update failure
Import From Excel File Into Mysql Database
Increment A Mysql Column - how to increment a MySQL column one unit
Complete Login System - With PHP + MYSQL
Mysql Database Setup : Setting Up Mysql Database - Guide to use MySQL database in your site
advertisement



Mysql Won't Update



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE