-
June 20th, 2006, 06:42 PM #1
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
-
June 21st, 2006, 12:48 AM #2
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.
-
June 21st, 2006, 01:26 AM #3
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
JkrohnSignatures blow hard
If your signature contains an ad of any kind, congratulations, you're on my ignore list.
-
June 21st, 2006, 09:16 AM #4
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.
-
June 21st, 2006, 09:40 AM #5
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.
-
June 21st, 2006, 09:13 PM #6
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.
-
June 21st, 2006, 10:47 PM #7
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.
JkrohnSignatures blow hard
If your signature contains an ad of any kind, congratulations, you're on my ignore list.
-
June 21st, 2006, 10:54 PM #8
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
-
June 23rd, 2006, 01:12 AM #9
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:
Ok here is the entire codePHP Code:mysql_select_db("xxxxxxxxxx_xxx") or die("Could not select database")
I am assuming I am missing an some little puntuation of some sort so please advise. ThanksPHP 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
}
}
?>Last edited by cableuser; June 23rd, 2006 at 01:49 AM.
-
June 23rd, 2006, 09:17 AM #10
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");
-
June 23rd, 2006, 09:01 PM #11
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 1Last edited by cableuser; June 23rd, 2006 at 09:40 PM.
-
June 23rd, 2006, 09:57 PM #12
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.
In fact unless you're using a special setup, $dbhost should be set to...PHP Code:echo $dbhost;
Echo out the query that is failing as well to see exactly what is being sent to the MySQL server.PHP Code:$dbhost="localhost";
Last edited by drizzle; June 23rd, 2006 at 10:00 PM.
-
June 24th, 2006, 02:12 PM #13
-
June 24th, 2006, 04:09 PM #14
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
-
June 24th, 2006, 05:15 PM #15Ultimate 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
-
June 24th, 2006, 06:00 PM #16
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.
-
June 24th, 2006, 07:05 PM #17Ultimate 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:
If they're all there, check to see that you can properly connect to the database through PHP:Code:adminurls bannerrotator bannerrotators brclients clients mailer members system
Finally, in bannerrotator.php after (line 14):PHP Code:<?
$link = mysql_connect("localhost","user","password");
@mysql_select_db("databaseName") or die( "Cant select database");
?>add:PHP Code:$db = mysql_pconnect($dbhost, $dbuser, $dbpass) or die("Could not connect");
Report any error messages back here... Be sure to post the entire error message, if any.PHP Code:echo mysql_errno($db) . ": " . mysql_error($db). "\n<br/>";
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
-
June 25th, 2006, 06:02 PM #18
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.
-
June 25th, 2006, 09:09 PM #19Ultimate 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
-
PHP Script!
By kgn in forum General Gaming DiscussionReplies: 0Last Post: February 2nd, 2006, 01:34 AM -
Need a PHP script
By compjason in forum Webmastering and ProgrammingReplies: 1Last Post: July 24th, 2005, 02:41 PM -
Looking for PHP script
By golfcart in forum Webmastering and ProgrammingReplies: 8Last Post: December 29th, 2003, 10:03 PM -
Help with PHP script
By omc1jz in forum Webmastering and ProgrammingReplies: 0Last Post: June 29th, 2003, 03:33 AM -
Script Help PhP
By Legacy in forum Webmastering and ProgrammingReplies: 6Last Post: November 9th, 2002, 09:53 PM



LinkBack URL
About LinkBacks




Reply With Quote



It's probably highly rated because of the level of violence. The story is decent.
Thread About Anime