Jump to content

Array being output. Unsure why.


Recommended Posts

The below is outputting:



Fatal error: Unsupported operand types in /home/zyquo/public_html/area51entertainment.co/maintenance/home.php on line 28


So clearly $project_row_num is coming out as an array, and the multiplication is failing because its got a string not a number. I just don't see why it's getting an array out of $project_row_num.



require_once 'db_select.php';
$project_query_num="SELECT COUNT(*) FROM $tbl_name";

echo $project_row_num;	
//if($project_row_num <= $num_projects){
$project_query="SELECT * FROM $tbl_name";
$project_query="SELECT * FROM $tbl_name WHERE project_release_date BETWEEN $start_date AND $end_date LIMIT 0,$num_projects";
$scroller_projects.='<div class="project_entry" tabindex="'.$i.'" onclick="sndReq(\''.$project_id.'\');">Test</div>';
<div class="video_scroller_wrapper">
<div class="video" id="tabs">


<div class="recentfilms_wrapper">
<div class="left_arrow"><img src="arrow_left.png" alt="Left" title=""  class="arrow_left" onclick="jumpLeft(\'recentfilms\')" onmouseover="startScrollLeft(\'recentfilms\')" onmouseout="stopScroll()" /></div> 
<div id="recentfilms">
<div id="scroller" style="width: '.$scroller_width.'px;">
<div class="right_arrow"><img src="arrow_right.png" alt="Left" title="" class="arrow_right" onclick="jumpRight(\'recentfilms\')" onmouseover="startScrollRight(\'recentfilms\')" onmouseout="stopScroll()" /></div>
<div class="news_wrapper">
<div class="news">
<div class="news_title"><span class="category_title_text">Latest News</span></div>
<div class="news_text">
<iframe src="http://www.indiegogo.com/project/widget/75876?a=9030" style="width: 224px; height: 429px; position: relative; left: 3px; top: 15px; border: 0px; overflow: hidden;"></iframe>

Link to comment
Share on other sites

Got it with this:


$project_query_num="SELECT COUNT(*) FROM $tbl_name";


Was trying to stay away from using mysql_num_rows; wanted to do the counting entirely with MySQL.




Link to comment
Share on other sites

Actually, since you are using a COUNT() in your query and you are not using an alias name, you would need to use mysql_fetch_row or mysql_fetch_array and then access the zero'th element of that array to get the count.


Do you have php's error_reporting set to E_ALL so that all the errors php detects will be reported and displayed? You would be getting several notice and perhaps warnings from your code.

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.

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.