Jump to content

jdwme

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jdwme's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. jdwme

    Query was empty

    You're probably right, but for what this is being used for, we needed seperate tables. Once the info populates to a table, we are dumping each table to do something with offline, right now though to get that dump I'm having to log into myPHPadmin and dump each table manually, I was trying to show the data on a webpage in a table and export it from there if possible just so someone wouldn't have to log into my cpanel to dump the data, which is what we are doing now.
  2. jdwme

    Query was empty

    Thanks MrMarcus, that explanation helped a lot. I've made the changes you suggested but wanted to ask if I declared round correctly. I'm getting round from my page with the dropdown, so should I use $round = $_POST['round']; to declare it properly? I tried that and made the corrections but I think something is wrong with my jquery on the page that is supposed to be calling this php file because it never populates anything.
  3. jdwme

    Query was empty

    $table value is being set though, it's set through an if statement the script is being run on a page where I have a dropdown box that lets you select round 5 or round 6, once you choose a round and hit go it should run the script to display the data from one of two tables in my database directly under my dropdown
  4. jdwme

    Query was empty

    so I've tried both suggestions here relating to the following code $query = mysql_query("SELECT * FROM $table ORDER BY channel"); $result = mysql_query($query) or die(mysql_errno().':'.mysql_error()); // the above will tell you what, if any, is the mysql error / O I've tried just $query = "SELECT * FROM $table ORDER BY channel" and it showed the error I also tried $result = ($query) or die(mysql_errno().':'.mysql_error()); // the above will tell you what, if any, is the mysql error / and it gives the same exact error.
  5. I'll start off by saying I'm just learning PHP but I'm running into an issue where I keep receiving a "Query was empty" error and was wondering if someone could look at my code to see where I'm going wrong. Any hel is greatly appreciated, I just can't seem to find the error. I was getting a boolean error until I added die to line 58 and that's when it starting saying the query was empty. <?php $db_host = 'localhost'; $db_user = '********_****'; $db_pwd = 'ithisismypassword'; $database_icon_score = '********_****_score'; $table_5 = 'round5_score_sheet'; $table_6 = 'round6_score_sheet'; $s = round; $con = mysql_connect($db_host, $db_user, $db_pwd); if (!$con) {die('Could not connect: ' . mysql_error()); } mysql_select_db("********l_****_score", $con); if (round == 5) { $table = round5_score_sheet; } if (round == 6) { $table = round6_score_sheet; } else { echo "Wrong Round"; } $query = mysql_query("SELECT * FROM $table ORDER BY channel"); $result = mysql_query($query) or die(mysql_errno().':'.mysql_error()); // the above will tell you what, if any, is the mysql error / echo "<html'> <head> <title>South Area ICON Scores</title> </head> <body> <div id='content'> <table> <tr> <th>EmployeeName</th> <th>Judge</th> <th>Round</th> <th>Channel</th> <th>Q1Comments</th> <th>Q1Score</th> <th>Q2Comments</th> <th>Q2Score</th> <th>Q3Comments</th> <th>Q3Score</th> <th>Q4Comments</th> <th>Q4Score</th> <th>Q5Comments</th> <th>Q5Score</th> <th>TotalScore</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['EmployeeName'] . "</td>"; echo "<td>" . $row['Judge'] . "</td>"; echo "<td>" . $row['Round'] . "</td>"; echo "<td>" . $row['Channel'] . "</td>"; echo "<td>" . $row['Q1Comments'] . "</td>"; echo "<td>" . $row['Q1Score'] . "</td>"; echo "<td>" . $row['Q2Comments'] . "</td>"; echo "<td>" . $row['Q2Score'] . "</td>"; echo "<td>" . $row['Q3Comments'] . "</td>"; echo "<td>" . $row['Q3Score'] . "</td>"; echo "<td>" . $row['Q4Comments'] . "</td>"; echo "<td>" . $row['Q4Score'] . "</td>"; echo "<td>" . $row['Q5Comments'] . "</td>"; echo "<td>" . $row['Q6Score'] . "</td>"; echo "<td>" . $row['TotalScore'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?>
×
×
  • 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.