Need help getting this php script up and running  | | |
June 20th, 2006, 07:42 PM
|
#1 (permalink)
| | Banned
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  |
| |
June 21st, 2006, 01:48 AM
|
#2 (permalink)
| | Banned
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. |
| |
June 21st, 2006, 02:26 AM
|
#3 (permalink)
| | Real gangstas sip on Yacc
Join Date: Oct 2001 Location: Suckas-ville
Posts: 4,552
|
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.
|
| |
June 21st, 2006, 10:16 AM
|
#4 (permalink)
| | Banned
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. |
| |
June 21st, 2006, 10:40 AM
|
#5 (permalink)
| | Real gangstas sip on Yacc
Join Date: Oct 2001 Location: Suckas-ville
Posts: 4,552
|
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. |
| |
June 21st, 2006, 10:13 PM
|
#6 (permalink)
| | Banned
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. |
| |
June 21st, 2006, 11:47 PM
|
#7 (permalink)
| | Real gangstas sip on Yacc
Join Date: Oct 2001 Location: Suckas-ville
Posts: 4,552
|
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 |
| |
June 21st, 2006, 11:54 PM
|
#8 (permalink)
| | Banned
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 |
| |
June 23rd, 2006, 02:12 AM
|
#9 (permalink)
| | Banned
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 02:49 AM.
|
| |
June 23rd, 2006, 10:17 AM
|
#10 (permalink)
| | Member
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");
|
| | | Thread Tools | Search this Thread | | | |
Similar Threads | | Thread | Thread Starter | Forum | Replies | Last Post | | PHP Script! | kgn | General Gaming Discussion | 0 | February 2nd, 2006 01:34 AM | | Need a PHP script | compjason | Webmastering and Programming | 1 | July 24th, 2005 03:41 PM | | Looking for PHP script | golfcart | Webmastering and Programming | 8 | December 29th, 2003 10:03 PM | | Help with PHP script | omc1jz | Webmastering and Programming | 0 | June 29th, 2003 04:33 AM | | Script Help PhP | Legacy | Webmastering and Programming | 6 | November 9th, 2002 09:53 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |