There is showing error but i am not able to solve, please help:
error is :
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 '' at line 1
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/content/s/c/h/schowhan/html/mm/wp-content/themes/limauorange/single.php on line 67
code is here:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><?php the_title(); ?></h2>
<div>
<?php the_content('<p class="serif">Read the rest of this entry »</p>'); ?>
<?php if ( function_exists('the_tags') ) { the_tags('<p>Tags: ', ', ', '</p>'); } ?>
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<br />
<p>
<small>
<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Both Comments and Pings are open ?>
<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Only Pings are Open ?>
Reviews are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site.
<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
// Comments are open, Pings are not ?>
You can skip to the end and write a review.
<?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
// Neither Comments, nor Pings are open ?>
<?php } edit_post_link('Edit this entry.','',''); ?>
</span>
</small>
</p>
</div>
</div>
<?php comments_template(); ?>
<div class="alignleft"><?php previous_post_link('« %link') ?></div>
<div class="alignright"><?php next_post_link('%link »') ?></div>
<?php endwhile; else: ?>
<p>Sorry, no posts matched your criteria.</p>
<?php endif; ?>
<?
$phoneid=the_ID();
echo $phoneid;
$query="SELECT testable.id, testable.name, testable.wpid, wp_posts.ID, wp_posts.post_title FROM testable, wp_posts where testable.wpid=$phoneid"; // query string stored in a variable
$rt=mysql_query($query); // query executed
echo mysql_error(); // if any error is there that will be printed to the screen
while($nt=mysql_fetch_array($rt)){
echo "$nt[id] $nt[name] $nt[color] $nt[network] $nt[wpid]<br>"; // name class and mark will be printed with one line break at the end
}
?>
What is issue, please guide and help me, I am not expert to php, but trying to learn it. thanks.