Current location: Hot Scripts Forums » Programming Languages » PHP » Need Some Help - Functions wont work


Need Some Help - Functions wont work

Reply
  #1 (permalink)  
Old 09-28-08, 05:44 AM
!Unreal's Avatar
!Unreal !Unreal is offline
Wannabe Coder
 
Join Date: Aug 2008
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
X_X Need Some Help - Functions wont work

I have this code:

PHP Code:

<?php

mysql_connect 
("localhost""unrealme_divx","password")  or die (mysql_error());
mysql_select_db ("unrealme_divx");

$id $_GET['id'];

$sql mysql_query("select * from divx where id like '$id'");

while (
$row mysql_fetch_array($sql)){
        }
        
echo 
'<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="720" height="360" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">

 <param name="custommode" value="none" />

  <param name="previewImage" value="http://www.tld.com/image.jpg" />
  <param name="autoPlay" value="false" />
  <param name="src" value="$row[\'url\']" />

<embed type="video/divx" src="$row[\'url\']" custommode="none" width="720" height="360" autoPlay="false"  previewImage="http://www.tld.com/image.jpg"  pluginspage="http://go.divx.com/plugin/download/">
</embed>
</object>'
;
    


?>
But the functions wont work. I don't know what I am doing wrong.

Please could someone 'debug' my code. That would be awesome. Ive been trying for hours and I just can't do it.

Thanks again, Unreal
__________________
Free Online Movies
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 09-28-08, 07:37 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
Your not putting the echo statement in the while loop and you have some syntax errors in your echo statement.

Try it like this:
PHP Code:

<?php
mysql_connect 
("localhost""unrealme_divx","password")  or die (mysql_error());
mysql_select_db ("unrealme_divx");
$id = empty($_GET['id']) ? "" $_GET['id'];
$sql mysql_query("select * from divx where id like '$id'");
if(
mysql_num_rows($sql) > 0)
{
 while(
$row mysql_fetch_assoc($sql))
 {
  echo 
'<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="720" height="360" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
         <param name="custommode" value="none" />
         <param name="previewImage" value="http://www.tld.com/image.jpg" />
         <param name="autoPlay" value="false" />
         <param name="src" value="'
.$row["url"].'" />
         <embed type="video/divx" src="'
.$row["url"].'" custommode="none" width="720" height="360" autoPlay="false"  previewImage="http://www.tld.com/image.jpg"  pluginspage="http://go.divx.com/plugin/download/"></embed>
        </object>'
;
  }
 }
?>
__________________
Jerry Broughton
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 09-28-08, 03:09 PM
!Unreal's Avatar
!Unreal !Unreal is offline
Wannabe Coder
 
Join Date: Aug 2008
Posts: 147
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by job0107 View Post
Your not putting the echo statement in the while loop and you have some syntax errors in your echo statement.

Try it like this:
PHP Code:

<?php

mysql_connect 
("localhost""unrealme_divx","password")  or die (mysql_error());
mysql_select_db ("unrealme_divx");
$id = empty($_GET['id']) ? "" $_GET['id'];
$sql mysql_query("select * from divx where id like '$id'");
if(
mysql_num_rows($sql) > 0)
{
 while(
$row mysql_fetch_assoc($sql))
 {
  echo 
'<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="720" height="360" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
         <param name="custommode" value="none" />
         <param name="previewImage" value="http://www.tld.com/image.jpg" />
         <param name="autoPlay" value="false" />
         <param name="src" value="'
.$row["url"].'" />
         <embed type="video/divx" src="'
.$row["url"].'" custommode="none" width="720" height="360" autoPlay="false"  previewImage="http://www.tld.com/image.jpg"  pluginspage="http://go.divx.com/plugin/download/"></embed>
        </object>'
;
  }
 }
?>
Thanks for cleaning that up. It works perfectly now
__________________
Free Online Movies
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 09-29-08, 07:02 AM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
Your welcome.
__________________
Jerry Broughton
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Freelance PHP Developer needed to work with Amberfly Ltd petebarr Job Offers & Assistance 3 07-03-09 01:23 PM
The Art Nexus seeking PHP programmers TheArtNexus Job Offers & Assistance 5 02-26-08 04:08 AM
I'm desperate for work, I'll do any work for cheap [PHP/MySQL] Anastas Job Offers & Assistance 17 02-12-06 12:18 PM
Functions dont work... dont know why Bobd314 PHP 2 02-07-04 06:19 PM


All times are GMT -5. The time now is 01:50 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.