Jump to content

swampone

Members
  • Posts

    41
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

swampone's Achievements

Member

Member (2/5)

0

Reputation

  1. each $row['grade']; contains number. I believe I have to use a while loop somehow.
  2. I need to be able to add all the numbers together collected from the database with mysql_fectch_array public function gradeQuery(){ $id = $this->idQuery(); $sql = "SELECT*FROM grades WHERE moviesID = '$id'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $num_rows = mysql_num_rows($result); }
  3. I have a php file that generates a string that I need to use in a .js (javascript)file. Being that php developers sometimes using javascript with php, Im hoping someone can help me with this, cause i dont know any javascript. //This is the varible inside the .js file var suggestionText = "I need to be able to include my string generated by the php file here...";
  4. scratch that last message. the database is not called users its called headstyle1. Sorry
  5. mysql_connect("headstyle1.db.xxxxxxx.hostedresource.com", "headstyle1", "Swampone4") or die(mysql_error()); mysql_select_db("users") or die(mysql_error()); Connection creds are correct.
  6. Im developing a registration script and using godaddy as my host. Im getting "Access denied for user 'headstyle1'@'%' to database 'users'" when running the registration script. Is there some kind of permission I have to set?
  7. $download will print on the screen on my localhost, but once I've uploaded it to my host and go to the website, everything else prints to the screen fine, but $download will not. When I view page source, shows nothing where $download should be. $link_pattern = "/<tr><td><a(.*)<\/tr>/sU"; preg_match_all($link_pattern,$cr,$dm); $downloads = $dm[0][0]; $pattern = '/src=\"/'; $replacement = 'src="http://www.triplestarent.com/images'; $download = preg_replace($pattern, $replacement, $downloads); ?> <div class ="container"> <br> <h1> <?php echo $title; ?> </h1> <br> <?php echo $image; ?> <br><br> <h2> Track List </h2> <?php echo $tracks; ?> <br><br> <h2> Download </h2> <br> <table> <?php echo $download; ?> </table> <br><br> </div>
  8. I am still having trouble with this, so let me see if i can be more clear. A user submits a comment through a html form. The comments makes it to the database, no problem, even if a user decide that they want to use double quotes on some of the words in their comment. The problem occurs when I pull the comment from the database and the user used double quotes in there comment, this is where i get the break in the comment. $query = "SELECT * FROM post"; $result = mysql($query); while($row = mysql_fetch_array($result)){ $comment = stripslashes($row["comment"]); echo $comment; } This works fine if a user submits a comment that doesn't contain the double quotes.
  9. I see that. But that's the way its stored in the database. Im finding that users want to put words in quotes.
  10. A user submit a comment to my database. If the user comment includes a word that has "" it stops the rest of the comment from being printed. I guess it has to be escaped somehow. $info = "this is a "testing" comment"; echo $info; //This will only print: this is a //I need it to print everything: this is a "testing" commentecho $info;
  11. Naw, the one line solved everything
  12. I knew it was something simple. Thanks a bunch!!!
  13. Im getting a syntax error caused by the first line. How do I properly escape the code? echo "<tr class="'.$colors[$i++ % 2].'"> <td align=center nowrap>($phone1) XXX-$phone2</td> <td align=center nowrap>$overall</td> <td align=center nowrap>$hygiene</td> <td align=center nowrap>$attitude</td> <td align=center nowrap>$ethnicity</td> <td align=center nowrap>$body</td> <td align=center nowrap>$city</td> <td align=center nowrap>$user</td> <td align=center nowrap>$date</td> <td align=center nowrap>$comment</td> </tr>";
  14. l have a video site, and each title is generated dynamically on a <li>. The problem is some titles are longer than others and spill on to the next <li> throwing my site all off. What i need to do is designate 2 lines for the titles just in case the title is too long. <ul> <li><?php echo $title; ?></li> <li>///continue $title or add blank line so it doesn't throw everything off</li> </ul>
×
×
  • 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.