• I was able to use this code in joomla and I have since converted to wordpress but the similar code is giving me errors.
    Joomla code

    <?php
    $data =new stdClass();
    $user =& JFactory::getUser();
    if (!$user->guest)
    {
    $tmp_id=$_GET['imageID'];
    $tmp_url=$_GET['imageURL'];
    $tmp_name=$_GET['imageName'];
    
    $data->image_id = $tmp_id;
    $data->image_url = $tmp_url;
    $data->image_name = $tmp_name;
    $data->user_name = $user->username;
    $data->stage = 1;
    
    $db = JFactory::getDbo();
    $db->insertObject('#__image_data', $data, image_id, $data, image_url, $data, image_name, $data, user_name, $data, stage);
         $query = " SELECT <code>image_url</code> FROM <code>#__image_data</code> WHERE <code>image_id</code> = $tmp_id ";
              $db->setQuery($query);
              $results = $db->loadObject();
              $img = $results->image_url;
         echo "<img src='$img'>";
         echo '     Owner: ' .$user->username;
    }
    ?>

    And here is my my wordpress PHP code

    <?php
    $tmp_id=$_GET['imageID'];
    $tmp_url=$_GET['imageURL'];
    $tmp_name=$_GET['imageName'];
    
    mysql_connect("localhost", "Flexxall", "thunder") or die(mysql_error());
     mysql_query ( "INSERT INTO wp_image_data (<code>image_id</code>)
     		VALUES (<code>$tmp_id</code>)")or die (mysql_error()); 
    
    echo 'Testing: ' . $temp_ID;
    
         echo 'Owner: ' . $current_user->user_login . "\n";
    
    ?>

    Here is tha page PHP that is calling my catch.php if this matters

    <?php
    
    // Exit if accessed directly
    if ( !defined('ABSPATH')) exit;
    
    //
    // Template Name: Catch template
    //
    include '../wordpress/wp-content/themes/responsive-child/catch.php';
    ?>
    
    <div id="logoImage" >
    
    </div>

    The error I get is Unknown column ’15’ in ‘field list’
    and the # (15) corresponds to the link that AS3 is passing

    wordpress/?page_id=81imageName=BaldEagle%2Epng&imageURL=http%3A%2F%2Flocalhost%2FJoomla3%2FcritterUploads%2FserverImages%2FbaldEagleEgg%2Epng&imageID=15

    I think that this ?page_id=81 is causing the issue but im not sure how to work around it.

    Any suggestions ?

The topic ‘PHP vars from AS3 not working in wordpress’ is closed to new replies.