+ Reply to Thread
Results 1 to 19 of 19
  1. #1
    Banned cableuser's Avatar
    Join Date
    Oct 2004
    Posts
    732

    Need help getting this php script up and running

     
    I need some help getting this php script up and running. I inserted all the info into the mysql file and uploaded the file to the database. Now I am getting an error:

    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '<?

    Now I really have no idea what I am doing so please be very very easy on me. I have spent alot of time on google searching for the answer and all I get is stuff I do not understand.

    So I really need the answer in complete 1st grade level english. Thankyou

  2. #2
    Banned cableuser's Avatar
    Join Date
    Oct 2004
    Posts
    732
    Sorry about this early bump but I am eager to get my site up and running after work tommorow if at all possible. Again, sorry for the early bump.

  3. #3
    Real gangstas sip on Yacc jkrohn's Avatar
    Join Date
    Oct 2001
    Location
    Suckas-ville
    Posts
    4,554
    Add a print line before you try to use the SQL and have it print what it is trying to send to MySQL.

    It appears thats you have an error in constructing your SQL string as it should not contain >? anywhere in it

    Jkrohn
    Signatures blow hard
    If your signature contains an ad of any kind, congratulations, you're on my ignore list.

  4. #4
    Banned cableuser's Avatar
    Join Date
    Oct 2004
    Posts
    732
    I romoved that >? line wherever I found it but the problem still exsists basically the mysql file just has a little intro from the maker of the script and than it has this.

    $dbhost = '...............';
    $dbuser = '.................';
    $dbpass = '.................';
    $dbname = '.................';

    I know that I entered all my info in correct so that is probably not the problem. I am guessing that more code needs to be added so that I do not get errors.

    I am still getting this error.

    #1064 - You have an error in your SQL syntax.

    Thanks again.

  5. #5
    Real gangstas sip on Yacc jkrohn's Avatar
    Join Date
    Oct 2001
    Location
    Suckas-ville
    Posts
    4,554
    Post the part where it actually creates the string for the SQL statement and sends that to the DB. Everything you posted above is fine.
    Signatures blow hard
    If your signature contains an ad of any kind, congratulations, you're on my ignore list.

  6. #6
    Banned cableuser's Avatar
    Join Date
    Oct 2004
    Posts
    732
    This is everything in the mysql file. As I said above it is just the little intro thing by the people who made the script and the rest is the login info. Here is exactly as it is.

    // This script is copyrighted to Pullan Enterprises
    // You are not allowed to copy this script
    // If you modify this script you may not claim copyrights.
    // You are not allowed to remove this header
    // We will take legal action against all violators.
    // MySQL database information
    $dbhost = 'xxxxxxxxxx';
    $dbuser = 'xxxxxxxxxx';
    $dbpass = 'xxxxxxxxxx';
    $dbname = 'xxxxxxxxxx';

    If there is anything I need to add this this script to make it work than please tell me.

    Thankyou for your time.

  7. #7
    Real gangstas sip on Yacc jkrohn's Avatar
    Join Date
    Oct 2001
    Location
    Suckas-ville
    Posts
    4,554
    Ok, one of two things is happening.

    1) There is an error in the code supplied to you.
    2) You are putting something funky into the string and it is just running on. This is much less likely.

    Is this an intro from a site somewhere? Could you send me all of the code (minus your db stuff) and I could rule out #1. The first option looks to be the issue though.

    Jkrohn
    Signatures blow hard
    If your signature contains an ad of any kind, congratulations, you're on my ignore list.

  8. #8
    Banned cableuser's Avatar
    Join Date
    Oct 2004
    Posts
    732
    How about you just get on AIM. I just made myself an AIM account so maby we can work this out on instant message. I think it would be alot easier and will take a lot less time. Oh, and if you are worried about me annoying you all the time I just want to tell you I won't so yeah just message me at cableuser18 for AIM I am on right now and probably will be for a little while longer. Hope this will make things easier. Than I can send you the the php files and you can look them over and you can help that way. I am just really a noob at all this so yeah.

    When you say send all the code do you mean send all the code in the php file that I uploaded to the database? I only uploaded this one file as that is all I thought I had to upload. Everything I posted in my previous post was everything in that one file. If you want be to send you more code than you have to be more specific as I have a bunch of files here with a lot of code. I am really and huge noob at this so I really do not know what you want me to send you. So yeah just message me so we can get this worked out easier and faster. Thanks

  9. #9
    Banned cableuser's Avatar
    Join Date
    Oct 2004
    Posts
    732
    Still in need of some help. But I did make some progress. I am now connected to the database! Now its just a matter of guess, test, and revise for me as I do not know what is supposed to be there and what is not. So now I am getting this:

    Parse error: parse error, unexpected T_STRING in /home/www/maxabileousexchange.com/bannerrotator.php on line 16
    That line of code goes as follows:

    PHP Code:
    mysql_select_db("xxxxxxxxxx_xxx") or die("Could not select database"
    Ok here is the entire code
    PHP Code:
    <?

    // This script is copyrighted to Pullan Enterprises
    // You are not allowed to copy this script
    // If you modify this script you may not claim copyrights.  
    // You are not allowed to remove this header
    // We will take legal action against all violators.  


    function brotator($br_rid) {
    foreach (
    array_keys($GLOBALS) as $i) {if(!isset(${$i})) global ${$i};}
    $br_exptype "Date (YYYYMMDDHHMMSS)";
    if (!
    $db) {
    $db mysql_pconnect("xxxxxxx""xxxxxxxx""xxxxxx") or die("Could not connect")

    mysql_select_db("xxxxxxxx") or die("Could not connect")
    }
        
    $br_updatesql "UPDATE bannerrotator SET status='Expired' WHERE exptype='$br_exptype' AND expires<=$now";

      
    $br_updateresult mysql_query($br_updatesql);
    $br_sql2 "SELECT * FROM bannerrotator WHERE adgroup='$br_rid' AND status='Normal' ORDER BY RAND() LIMIT 1";
        
    $br_result2 mysql_query($br_sql2) or die("Query failed");

        
    $br_myrow2 mysql_fetch_array($br_result2);
    $br_tid $br_myrow2["id"];
    $br_newviews $br_myrow2["views"] + 1;
    if (
    $br_myrow2["exptype"] == "Views" && $br_newviews == $br_myrow2["expires"]) {

        
    $br_sql3 "UPDATE bannerrotator SET views=views+1,status='Expired'  WHERE id='$br_tid'";

    } else {
        
    $br_sql3 "UPDATE bannerrotator SET views=views+1 WHERE id='$br_tid'";

    }
      
    $br_result3 mysql_query($br_sql3) or die("Query failed");

    if (
    $br_myrow2["type"] == "HTML") {
    echo 
    $br_myrow2["html"];
    } elseif (
    $br_myrow2["type"] == "Image") {
    ?>
    <a href="<?php echo $url ?>/bclick.php?go=<?php echo $br_myrow2["id"?>" target="_blank"><img src="<?php echo $br_myrow2["image"?>" ALT="<?php echo $br_myrow2["alt"?>" border="0" height="<?php echo $br_myrow2["ih"?>" width="<?php echo $br_myrow2["iw"?>"></a>
    <?php
    }
    }
        
    ?>
    I am assuming I am missing an some little puntuation of some sort so please advise. Thanks
    Last edited by cableuser; June 23rd, 2006 at 01:49 AM.

  10. #10
    Member drizzle's Avatar
    Join Date
    Oct 2001
    Location
    Louisiana, USA
    Posts
    256
    That's a syntax error. Add a ';' to the end of the line...
    PHP Code:
     mysql_select_db("xxxxxxxxxx_xxx") or die("Could not select database"); 

  11. #11
    Banned cableuser's Avatar
    Join Date
    Oct 2004
    Posts
    732
    Ok thanks the problem is fixed now. Now I get a query failed error. Please advise on how to fix. Thanks.
    More specifcally is this. Looks like I am back where I started.

    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '$dbhost = 'xxxxxxxxxxxxxxxxxxx'' at line 1
    Last edited by cableuser; June 23rd, 2006 at 09:40 PM.

  12. #12
    Member drizzle's Avatar
    Join Date
    Oct 2001
    Location
    Louisiana, USA
    Posts
    256
    echo out those variables and make sure they're OK. Looks like you have a character in there thowing it off - check to make sure you aren't mixing single/double quotes.

    PHP Code:
    echo $dbhost
    In fact unless you're using a special setup, $dbhost should be set to...
    PHP Code:
    $dbhost="localhost"
    Echo out the query that is failing as well to see exactly what is being sent to the MySQL server.
    Last edited by drizzle; June 23rd, 2006 at 10:00 PM.

  13. #13
    Banned cableuser's Avatar
    Join Date
    Oct 2004
    Posts
    732
    I did exactly as you said and I still get the exact same error.

  14. #14
    Banned cableuser's Avatar
    Join Date
    Oct 2004
    Posts
    732
    Ok someone needs to help me. My patience are running thin as I have been trying to get this working for a week. Yes I was trying before I posted here. Here is all the files please edit them so that I can just add my login info and be done with it. Please note that this script is copyright so please do not use it on your website. Thank you for your help so far but I really need to get this up asap.

    You can download the file here. http://bertschkid.50webs.net/traffic.zip

  15. #15
    Ultimate Member
    Join Date
    Dec 2004
    Posts
    1,558
    Ummmm... it works fine for me . I setup the database, imported the SQL file, put my connection info in mysql.php and fired it up. Running PHP v5.1.2 and MySQL v5.0.19.
    "Be quiet, Brain, or I'll stab you with a Q-tip"
    -Homer Simpson

  16. #16
    Banned cableuser's Avatar
    Join Date
    Oct 2004
    Posts
    732
    Than I seriously must be an idiot if I can not get this up and running. I have tried it on two different webhosts with the same resaults. Hmmmm..... Do I have to do anything special when I create a database? I just made a screen name added a password and boom that was all. Than I just when to phpmyadmin and hit the upload button to upload the mysql file. Is that all I have to do?
    H*** S*** I am an idiot
    Last edited by cableuser; June 24th, 2006 at 06:20 PM.

  17. #17
    Ultimate Member
    Join Date
    Dec 2004
    Posts
    1,558
    Hehe... Well let's see... Check to make sure all the tables were imported, this should be all of them:
    Code:
    adminurls
    bannerrotator
    bannerrotators
    brclients
    clients
    mailer
    members
    system
    If they're all there, check to see that you can properly connect to the database through PHP:
    PHP Code:
    <?
    $link 
    mysql_connect("localhost","user","password");
    @
    mysql_select_db("databaseName") or die( "Cant select database");
    ?>
    Finally, in bannerrotator.php after (line 14):
    PHP Code:
    $db mysql_pconnect($dbhost$dbuser$dbpass) or die("Could not connect"); 
    add:
    PHP Code:
    echo mysql_errno($db) . ": " mysql_error($db). "\n<br/>"
    Report any error messages back here... Be sure to post the entire error message, if any.

    If all of those check out, it might be that your version(s) of MySQL and/or PHP are outdated and the script requires a newer version.
    "Be quiet, Brain, or I'll stab you with a Q-tip"
    -Homer Simpson

  18. #18
    Banned cableuser's Avatar
    Join Date
    Oct 2004
    Posts
    732
    In my previous post I mentioned I was a complete idiot and I will tell you why. I tried importing the mysql.php files to the database instead of the real .sql files that I should have been trying to upload. That was my problem all along. So yeah I am pretty much a complete idiot.

  19. #19
    Ultimate Member
    Join Date
    Dec 2004
    Posts
    1,558
    Oh, lol... Well glad ya got it all working
    "Be quiet, Brain, or I'll stab you with a Q-tip"
    -Homer Simpson

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. PHP Script!
    By kgn in forum General Gaming Discussion
    Replies: 0
    Last Post: February 2nd, 2006, 01:34 AM
  2. Need a PHP script
    By compjason in forum Webmastering and Programming
    Replies: 1
    Last Post: July 24th, 2005, 02:41 PM
  3. Looking for PHP script
    By golfcart in forum Webmastering and Programming
    Replies: 8
    Last Post: December 29th, 2003, 10:03 PM
  4. Help with PHP script
    By omc1jz in forum Webmastering and Programming
    Replies: 0
    Last Post: June 29th, 2003, 03:33 AM
  5. Script Help PhP
    By Legacy in forum Webmastering and Programming
    Replies: 6
    Last Post: November 9th, 2002, 09:53 PM

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Recommended Sites: ResellerRatings Store Reviews