home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Need help getting this php script up and running

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2333
Discussions: 200,944, Posts: 2,379,343, Members: 246,306
Old June 20th, 2006, 07:42 PM   Digg it!   #1 (permalink)
Banned
 
cableuser's Avatar
 
Join Date: Oct 2004
Posts: 732
Send a message via AIM to cableuser
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
cableuser is offline   Reply With Quote
Old June 21st, 2006, 01:48 AM     #2 (permalink)
Banned
 
cableuser's Avatar
 
Join Date: Oct 2004
Posts: 732
Send a message via AIM to cableuser
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.
cableuser is offline   Reply With Quote
Old June 21st, 2006, 02:26 AM     #3 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,552
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
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.
jkrohn is offline   Reply With Quote
Old June 21st, 2006, 10:16 AM     #4 (permalink)
Banned
 
cableuser's Avatar
 
Join Date: Oct 2004
Posts: 732
Send a message via AIM to cableuser
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.
cableuser is offline   Reply With Quote
Old June 21st, 2006, 10:40 AM     #5 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,552
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
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.
jkrohn is offline   Reply With Quote
Old June 21st, 2006, 10:13 PM     #6 (permalink)
Banned
 
cableuser's Avatar
 
Join Date: Oct 2004
Posts: 732
Send a message via AIM to cableuser
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.
cableuser is offline   Reply With Quote
Old June 21st, 2006, 11:47 PM     #7 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,552
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
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
jkrohn is offline   Reply With Quote
Old June 21st, 2006, 11:54 PM     #8 (permalink)
Banned
 
cableuser's Avatar
 
Join Date: Oct 2004
Posts: 732
Send a message via AIM to cableuser
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
cableuser is offline   Reply With Quote
Old June 23rd, 2006, 02:12 AM     #9 (permalink)
Banned
 
cableuser's Avatar
 
Join Date: Oct 2004
Posts: 732
Send a message via AIM to cableuser
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.
cableuser is offline   Reply With Quote
Old June 23rd, 2006, 10:17 AM     #10 (permalink)
Member
 
drizzle's Avatar
 
Join Date: Oct 2001
Location: Louisiana, USA
Posts: 256
Send a message via MSN to drizzle
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"); 
drizzle is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Making Health Care Worse (163)
The disrespect of Obama by Russian .. (16)
Is It Just Me? (2918)
Wireless Televisions. (11)
windows 7 problem (7)
CPU fan stops spinning randomly (8)
Regular Build (6)
Is the PSU I received dead? (11)
Print spooler problem (15)
HIS HD5770 graphic card question (15)
windows vista security holes (9)
Install XP pro and a Vista laptop ?.. (11)
Foreign voltage (10)
Dept. of HS: NSA 'Helped' Develop V.. (15)
Recent Discussions
How to convert MP3's (1)
windows 7 internet problem (5)
Multiple Restarts Required at Boot (0)
BSOD On Startup (ntoskrnl.exe) (2)
Print spooler problem (15)
Laptop with wireless problem. (1)
Wireless Televisions. (11)
Have you switched yet? (86)
Asus P4G8X Mobo (5)
screen resolution vs monitor size (2)
radeon x850xt platinum & shader 3 (4)
sms storage to PC (0)
Regular Build (6)
Open With ..... Win7 (0)
java code for fibonacci (1)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (35)
windows 7 problem (7)
CPU fan stops spinning randomly (8)
Partition Magic caused HDD problem (3)
Is the PSU I received dead? (11)
Point and Shoot Camera Suggestions. (2)
Modern Warfare 2 freeze (13)
wireless user (1)
World's largest Monopoly Game using G.. (332)
Ideal cheap graph card for PC-Gaming? (17)


All times are GMT -4. The time now is 05:58 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28