Jump to content

[SOLVED] Getting the correct syntax


RAH

Recommended Posts

Hi,

 

I've been having some difficulty getting the correct syntax for this.  Let me explain the issue - the script in it's current state below is working however videoFile:"abc.com/video.flv" bit is causing an issue.  It needs to be in single quotes for the flash player to play the video.  However all attempts to correct this have ended up in a multitude of errors and issues.  What is the correct way of achieving this?

 

Script excerpt:

 

@mysql_query('INSERT INTO jos_content (title, title_alias, introtext, state, sectionid, mask, catid, created, created_by, created_by_alias, modified, modified_by, checked_out, checked_out_time, publish_up, publish_down, images, urls, attribs, version, parentid, ordering, metakey, metadesc, access, hits) VALUES (\'' . $title .'\',\'' . $title .'\',\'<object type="application/x-shockwave-flash" data="player.swf" '
        . ' width="320" height="262" id="FlowPlayer">'
        . ' <param name="allowScriptAccess" value="sameDomain" />'
        . ' <param name="movie" value="http://tvloser.com/videos/' . $md5 . '.flv">'
        . ' <param name="quality" value="high">'
        . ' <param name="scale" value="noScale">'
        . ' <param name="wmode" value="transparent">'
        . ' <param name="flashvars" value="config={videoFile:"http://tvloser.com/videos/' . $md5 . '.flv",autoPlay: true}">'
        . ' </object></textarea>'
        . ' </div>\', \'1\', \'2\', \'0\', \'3\', \'2007-08-10 11:54:06\', \'62\', \'\', \'0000-00-00 00:00:00\', \'62\', \'0\', \'0000-00-00 00:00:00\', \'2007-08-10 11:54:06\', \'0000-00-00 00:00:00\', \'\', \'\', \'pageclass_sfx='
        . ' back_button='
        . ' item_title=1'
        . ' link_titles='
        . ' introtext=1'
        . ' section=0'
        . ' section_link=0'
        . ' category=0'
        . ' category_link=0'
        . ' rating='
        . ' author='
        . ' createdate='
        . ' modifydate='
        . ' pdf='
        . ' print='
        . ' email='
        . ' keyref='
        . ' docbook_type='
        . ' html_title=$title'
        . ' robots=-1'
        . ' google_cache=1'
        . ' google_snippet=1\', \'2\', \'0\', \'1\', \'METAKEY FIELD\', \'META DESC FIELD\', \'0\', \'0\')');
    }
    
}

Link to comment
Share on other sites

Did you try removing the error suppressant(@) and adding an or die statement? Try:

 

$sql = 'INSERT INTO jos_content (title, title_alias, introtext, state, sectionid, mask, catid, created, created_by, created_by_alias, modified, modified_by, checked_out, checked_out_time, publish_up, publish_down, images, urls, attribs, version, parentid, ordering, metakey, metadesc, access, hits) VALUES (\'' . $title .'\',\'' . $title .'\',\'<object type="application/x-shockwave-flash" data="player.swf" '
        . ' width="320" height="262" id="FlowPlayer">'
        . ' <param name="allowScriptAccess" value="sameDomain" />'
        . ' <param name="movie" value="http://tvloser.com/videos/' . $md5 . '.flv">'
        . ' <param name="quality" value="high">'
        . ' <param name="scale" value="noScale">'
        . ' <param name="wmode" value="transparent">'
        . ' <param name="flashvars" value="config={\'videoFile:"http://tvloser.com/videos/' . $md5 . '.flv",autoPlay: true\'}">'
        . ' </object></textarea>'
        . ' </div>\', \'1\', \'2\', \'0\', \'3\', \'2007-08-10 11:54:06\', \'62\', \'\', \'0000-00-00 00:00:00\', \'62\', \'0\', \'0000-00-00 00:00:00\', \'2007-08-10 11:54:06\', \'0000-00-00 00:00:00\', \'\', \'\', \'pageclass_sfx='
        . ' back_button='
        . ' item_title=1'
        . ' link_titles='
        . ' introtext=1'
        . ' section=0'
        . ' section_link=0'
        . ' category=0'
        . ' category_link=0'
        . ' rating='
        . ' author='
        . ' createdate='
        . ' modifydate='
        . ' pdf='
        . ' print='
        . ' email='
        . ' keyref='
        . ' docbook_type='
        . ' html_title=$title'
        . ' robots=-1'
        . ' google_cache=1'
        . ' google_snippet=1\', \'2\', \'0\', \'1\', \'METAKEY FIELD\', \'META DESC FIELD\', \'0\', \'0\')';
	mysql_query($sql) or die(mysql_error().'<br /><br />Query:'.$sql);

 

Ive assigned the query string to a variable so we can see the actual query if there is an error.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.