+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 15 of 32

Thread: downloaded php/mysql/flash poll. "supplied argument" errors

  1. #1
    Active Member WorldBuilder is on a distinguished road
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    366

    downloaded php/mysql/flash poll. "supplied argument" errors

    Hi all,

    I downloaded a premade script written in php. Here's where I got it from:

    http://www.sephiroth.it/file_detail.php?id=51

    First, I had some trouble with the Flash, but airnine was kind enough to try to help me out here. I got that worked out, but the php/mysql is having issues now.

    It seems that a lot of people are having trouble with this script, and so am I. I tried e-mailing the author of the script, but I don't think he's going to help out. :P I thought I'd ask for help here.

    Ok, first of all, I know very little about php/mysql. I've created a FEW databases and tables and done minimal php coding, but please consider me a dolt when it comes to these things.

    When I go to the admin.php file in a browser to set up the poll, I input the options I want, click to submit, and I get the following message:
    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/www/poll/admin.php on line 42

    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/www/poll/admin.php on line 43
    Apparently, this script is SUPPOSED to create all the tables, etc automatically, but that is obviously not happening. I've attached a zip file with all the necessary files that came with the original script (plus the swf file I had to make). Could someone please take a look and help me figure out what's wrong and how to fix it? Thanks!

    Chris
    Attached Files Attached Files
    My Site | My Blog
    "The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
    "Insanity is doing the same thing over and over again, expecting different results"
    --Albert Einstein

  2. #2
    Full Member dzone is on a distinguished road
    Join Date
    Dec 2003
    Posts
    75
    Try to add this

    PHP Code:
        $conn = @mysql_pconnect($host$db_user$db_pass);
        @
    mysql_select_db($db$conn); 
    before

    PHP Code:
    /*****************************************/ 
    in config.inc.php

    That should work imo...

  3. #3
    Full Member dzone is on a distinguished road
    Join Date
    Dec 2003
    Posts
    75
    P.S. and don't forget to set up user/pass etc. as well. And yes, it looks like the script creates everything he needs itself.

  4. #4
    Active Member WorldBuilder is on a distinguished road
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    366
    Thanks for the reply, mon ami.

    Ok, I added the code you suggested. Now, when I go to the admin.php page to set up the poll it no longer gives me those errors, but a blank screen instead. That's progress at least!

    I looked in my phpmyadmin page and there has been no database creation. How can I set up a password and username for a database that doesn't exist? What steps do I need to take here. Remember, I'm a php/mysql n00b.

    Thanks!

    Chris
    My Site | My Blog
    "The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
    "Insanity is doing the same thing over and over again, expecting different results"
    --Albert Einstein

  5. #5
    Full Member dzone is on a distinguished road
    Join Date
    Dec 2003
    Posts
    75
    WorldBuilder

    De rien...

    Hey, you must create a database for the script! It will create the tables itself, but not the DB. DB's name should be filled in $db = "dbname" ..

  6. #6
    Active Member WorldBuilder is on a distinguished road
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    366
    Ok, I did create the database with no tables. Ran the admin.php file, same trouble. Just a blank screen. I guess I have to set up the UN and password in phpmyadmin. Where do I go to do that? I click "privileges" and the db I created (called "flashpoll") is not listed. Is this because it has no tables?

    In the database list, though, "flashpoll" is listed. How do I set up the UN and password for this new database? Thanks!

    Chris
    My Site | My Blog
    "The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
    "Insanity is doing the same thing over and over again, expecting different results"
    --Albert Einstein

  7. #7
    Active Member WorldBuilder is on a distinguished road
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    366
    Ok,

    My config.inc.php file has been altered to this:
    Code:
    <?
        $conn = @mysql_pconnect($host, $db_user, $db_pass); 
        @mysql_select_db($db, $conn);
        /******************************************
        *   MYSQL_PHP_FLASH POLL
        *   V.1
        *   Sephiroth - Alessandro Crugnola
        *   alessandro@sephiroth.it
        *   http://www.sephiroth.it
        ******************************************/
    
        /***   mysql connection information   ****/
        /*****************************************/
        $db = "flashpoll";
        $host = "localhost";
        $db_user = "chris";
        $db_pass = "xxxxxx";
        $table = "poll";
        $tempo = 640000;
        $pass = "sam76937";  // password used in admin interface
        $pollName = "poll";   // poll title
        /*****************************************/
    ?>
    In phpmyadmin, I created a new user called "chris" with the proper password (thus reflecting the changes to these variables above). Still getting a blank screen in the poll admin page after submitting the poll info I desire. Ugh... Any thoughts?

    Chris
    My Site | My Blog
    "The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
    "Insanity is doing the same thing over and over again, expecting different results"
    --Albert Einstein

  8. #8
    Full Member dzone is on a distinguished road
    Join Date
    Dec 2003
    Posts
    75
    You should put

    $conn = @mysql_pconnect($host, $db_user, $db_pass);
    @mysql_select_db($db, $conn);

    AT THE END of the script, where all the password/user/table/db stuff is set. Otherwise it just tries to connect with empty un/pwd.

  9. #9
    Active Member WorldBuilder is on a distinguished road
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    366
    That's been done. The db has been created as well as the UN and password in phpmyadmin. I've also been IMing Matt about it, and we're both stumped, man. Argh! LOL. Any other ideas?

    Chris
    My Site | My Blog
    "The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
    "Insanity is doing the same thing over and over again, expecting different results"
    --Albert Einstein

  10. #10
    Active Member WorldBuilder is on a distinguished road
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    366
    Just to get the most updated files, here's a zip file with all the updates!
    Attached Files Attached Files
    My Site | My Blog
    "The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
    "Insanity is doing the same thing over and over again, expecting different results"
    --Albert Einstein

  11. #11
    Full Member dzone is on a distinguished road
    Join Date
    Dec 2003
    Posts
    75
    Thus it should be a problem with your DB and not the script. I have just downloaded and unpacked it, created a database "poll" and set the ini file to the following:

    PHP Code:
    <?
        $db 
    "poll";
        
    $host "localhost";
        
    $db_user "root";
        
    $db_pass "";
        
    $table "poll";
        
    $tempo 640000;
        
    $pass "";  // password used in admin interface
        
    $pollName "poll";   // poll title
        
    $conn = @mysql_pconnect($host$db_user$db_pass); 
        @
    mysql_select_db($db$conn);
    ?>
    I have a root access to my local server with no password and I don't want the admin password either.

    Do you have JS enabled?

    I have the following in my "mysql" database in table "user":

    INSERT INTO `user` (`Host`, `User`, `Password`, `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Reload_priv`, `Shutdown_priv`, `Process_priv`, `File_priv`, `Grant_priv`, `References_priv`, `Index_priv`, `Alter_priv`) VALUES ('%', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');

    You might want to create a "god" user with similar priveleges for testing. I that'll work you have probs with mySQL permissions.

  12. #12
    Active Member WorldBuilder is on a distinguished road
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    366
    ZYV,

    Thanks for all your suggestions. I have the same user info you do (except for the name and password), but it still isn't working. I'm not getting any errors, just a blank screen after I put info into the admin page of the poll setup. I don't see what I'm doing wrong in the db. If you use phpmyadmin, what are the exact steps I need to take to set it up properly. I MUST be doing something wrong, but darned if I know what it is. If it would be best, I can delete everything and start from scratch.

    Chris
    My Site | My Blog
    "The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
    "Insanity is doing the same thing over and over again, expecting different results"
    --Albert Einstein

  13. #13
    Full Member dzone is on a distinguished road
    Join Date
    Dec 2003
    Posts
    75
    WorldBuilder,

    I do use phpMyAdmin. The only thing I did is to create the DB (there is an input box on the front page). Then I altered the config and that worked.

    Another thing for you is to try to remove the " @" in the config. @'s suppress the error messages and they might be somehow usefull in your case...

  14. #14
    Active Member WorldBuilder is on a distinguished road
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    366
    Ok, I created a db named "flashpoll" with NO tables. Then, I created a user named "chris" with password equal to what is in the config.inc.php file. That user has Global privileges set to ALL PRIVILEGES. Grant is set to "yes", and Table-specific privileges is also set to "yes". That user is also bound to database "flashpoll".

    All my php files are as you see them in the above zip file. Am I missing anything in my database setup?

    Chris

    PS. I take it that you have tried this yourself and gotten it to work?
    PPS. Call me Chris
    My Site | My Blog
    "The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
    "Insanity is doing the same thing over and over again, expecting different results"
    --Albert Einstein

  15. #15
    Active Member WorldBuilder is on a distinguished road
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    366
    Ok, I just noticed something very weird. In phpmyadmin, when I use the drop down menu on the left to select "flashpoll", then I click "Browse", I DO see a table in there with domanda set to "Working?". Now, the last time I tested the admin page by putting info in there, the question I simply asked in the poll was, in fact, "Working?".

    Now, if you go to www.bartlett-family.net/poll , you'll actually see that it DOES seem to be working (well, sorta). I think there's something wrong with the Flash. I'll keep you posted...

    Chris
    My Site | My Blog
    "The world is a dangerous place, not because of those who do evil, but because of those who look on and do nothing."
    "Insanity is doing the same thing over and over again, expecting different results"
    --Albert Einstein

+ Reply to Thread
Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts