| | |
Somebody please help me I'm going insane
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
Hi there, for the life of me I can't work out what is wrong with this script, but when it runs I get this message.
Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in....
If anyone can help it would be greatly appreciated.
Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in....
PHP Syntax (Toggle Plain Text)
<? $q6 = "select * from banners where lang = \"$_SESSION[lang]\" and section = \"top\" ORDER BY RAND() limit 1"; $r6 = mysql_query($q6) or die(mysql_error(Error5)); while($a6 = mysql_fetch_array( $r6 )) { echo "$a6[content]"; } ?>
If anyone can help it would be greatly appreciated.
0
#4 Oct 15th, 2009
Try this:
PHP Syntax (Toggle Plain Text)
$q6 = "SELECT * FROM banners WHERE lang='{$_SESSION['lang']}' AND section='top' ORDER BY RAND() LIMIT 1";
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
•
•
Join Date: Oct 2009
Posts: 15
Reputation:
Solved Threads: 6
1
#5 Oct 15th, 2009
Please check if this works:
php Syntax (Toggle Plain Text)
$lang = $_SESSION['lang']; $q6 = sprintf("SELECT * FROM banners WHERE lang='%s' AND section='top' ORDER BY RAND() LIMIT 1",mysql_real_escape_string($lang));
Last edited by webexpertzhere; Oct 15th, 2009 at 1:20 pm.
![]() |
Similar Threads
- svchost.exe error (Windows NT / 2000 / XP)
- OMFG I need help with endless reboot cycle / freeze up... insane please help! (Windows NT / 2000 / XP)
- Add or Remove Programs... Removed? (Windows NT / 2000 / XP)
- Restarting a windows 2000 computer from the command line (Windows NT / 2000 / XP)
- Seti@Home (Geeks' Lounge)
- School connection...? (Networking Hardware Configuration)
Other Threads in the PHP Forum
- Previous Thread: PHP equivalent for unescape()
- Next Thread: template system
Views: 264 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery js limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube





