Jump to content

ZandarKoad

New Members
  • Posts

    2
  • Joined

  • Last visited

ZandarKoad's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I spent the last two hours deleting parts of the css file until it was all gone. I've deleted everything I possibly can, and yet the (second) table STILL won't go to the top. You'll notice I threw in a random non-php table that jumped to the top just fine... It seems like just having some PHP processing forces the table down some random distance... I'm lost. Here's the URL: http://gator3241.hostgator.com/~zandar/zetabeta/index2.php Here's the code: <?php $servername = "123.123.123.123"; $username = "------"; $password = "------"; $dbname = "zandar_zetabeta"; $firsttablename = "english_phrases"; $secondtablename = "cebuano_phrases"; mysql_connect($servername,$username,$password); @mysql_select_db($dbname) or die("Unable to select database"); $query="SELECT phrase_index_key, phrase_content, author FROM english_phrases"; $en_result=mysql_query($query); $en_num=mysql_numrows($en_result); $query2="SELECT phrase_index_key, phrase_content, author FROM cebuano_phrases"; $ceb_result=mysql_query($query2); $ceb_num=mysql_numrows($ceb_result); mysql_close(); ?> <table style="width:100%"> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>94</td> </tr> </table> <table> <tr><th>Phrase ID</th><th>English Phrase</th><th>Cebuano Phrase</th><th>Author</th></tr> <? $i = 0; while ($i < $en_num) { $field1name = mysql_result($en_result, $i, "phrase_index_key"); $field2name = mysql_result($en_result, $i, "phrase_content"); //English $field3name = mysql_result($ceb_result, $i, "phrase_content"); //Cebuano $field4name = mysql_result($en_result, $i, "author"); echo "<tr>"; echo "<td>$field1name</td> <td>$field2name</td> <br> <td>$field3name</td> <td>$field4name</td> <br>"; echo "</tr>"; $i++; } ?> </table>
  2. I was using a PDO version of the PHP querry code that used RecursiveIteratorIterator to spit out the display, but wrapping my brain around those multi-level sub-sub nested abstract classes was making my brain bleed. I had thought it was a problem with the HTML syntax, but that appears not to be the case. I went with a dumber version of an HTML table display snippet, and I'm having the same problem. This MySQL query works great in PHPMyAdmin and on Workbench, but when I put it into a .php file on a live site, it won't ever display any content from the "english_phrases.phrase_content" column. It doesn't throw any errors. Just puts out blanks where English phrases should be. As you can see, it works great in PHPMyAdmin: Here's the PHPMyAdmin output: http://screencast.com/t/wM6xiJ08a Here's the live output: http://screencast.com/t/oBHJmNoT0U Any ideas? mysql_connect($servername,$username,$password); @mysql_select_db($dbname) or die("Unable to select database"); $query="SELECT english_phrases.phrase_index_key, english_phrases.phrase_content, cebuano_phrases.phrase_content, english_phrases.author FROM english_phrases LEFT JOIN cebuano_phrases ON english_phrases.phrase_index_key=cebuano_phrases.phrase_index_key"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo "<b> <center>Database Output</center> </b> <br> <br>"; echo "<table align='center' style='border: solid 1px black;'>"; echo "<tr style='width:200px;border1px solid black;'><th>Phrase ID</th><th>English Phrase</th><th>Cebuano Phrase</th><th>Author</th></tr>"; // <td style='width:150px;border:1px solid black;'> $i = 0; while ($i < $num) { $field1name = mysql_result($result, $i, "english_phrases.phrase_index_key"); $field2name = mysql_result($result, $i, "english_phrases.phrase_content"); //This NEVER displays content! $field3name = mysql_result($result, $i, "cebuano_phrases.phrase_content"); $field4name = mysql_result($result, $i, "english_phrases.author");
  3. I've done some stuff with PHP, but now I'm getting into it full time, hard core. Going to use Laravel. Have lots of projects I want to work on. Real quick, to Ober: Over here you have a link to a missing file. In case you couldn't tell, I'm going to do my best to read all the documentation first. I'm certain I'll have plenty of questions, nevertheless. I'm looking forward to making the documenation as comprehensible as possible along the way.
×
×
  • 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.