[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Parse Error - Unexpected $

Asked by lvollmer in PHP and Databases

Tags: parse, unexpected

I have a page that needs to load a different backround image in a table everytime the page is refreshed. I have hardcoded a portion of the URL into a table and have used  a select RAND to call the URL.

This is probably a simple syntax error, so maybe another set of eyes would help. Or, p[erhaps, my whole logic is off

Parse error: parse error, unexpected $ in /var/home/thrnewmedia/thrnewmedia.com/www/newhv/template.php on line 45
(line 45 is the last line of the code - </HTML> so I do not know what is up with that)

Code:

<body>
<?
$conn = @mysql_connect("localhost", "db", "pass") OR DIE("Unable to connect to the database");
$db = "db";
$db1 = @mysql_select_db($db,$conn) or die("Database error");
$query= "SELECT * FROM img ORDER BY RAND() limit 1";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

$i=0;
while ($i < $num) {

$img=mysql_result($result,$i,"url");
?>

<div align="center">

<table cellpadding="0" width="760" height ="400" background= "<?php echo $img ?>.jpg ">
<tr>
            <td height="230" valign="top" width="517" rowspan="2">&nbsp;</td>
            <td height="98" valign="top" width="237">&nbsp;</td>
</tr>
<tr>
            <td height="296" valign="top" width="237">&nbsp;</td>
</tr>
</table>
</div>
</body>
[+][-]11/08/05 08:26 AM, ID: 15248589Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: PHP and Databases
Tags: parse, unexpected
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 4
Solution Grade: A
 
[+][-]11/08/05 07:17 AM, ID: 15247843Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/05 07:18 AM, ID: 15247855Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/05 07:20 AM, ID: 15247873Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/05 07:31 AM, ID: 15247991Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/08/05 07:34 AM, ID: 15248017Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/08/05 07:53 AM, ID: 15248237Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]11/08/05 08:15 AM, ID: 15248490Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11/08/05 08:22 AM, ID: 15248556Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11/08/05 08:33 AM, ID: 15248665Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92