Jump to content

PrettyHotProgrammer

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Everything posted by PrettyHotProgrammer

  1. THANKS VERY MUCH TO EVERYONE FOR HELPING OUT!!!
  2. What do you think if we change header("Location: MyURL");"); that to this header("Location: MyURL"); haha the little things that we miss eh?
  3. They are in Different Files... the form is in a file called NewAssignment.php and it goes to NewAssignment3.php and the Config file is just Simply full of Variables that I am using... that is where I am storing everything I will try to do the echo statement that you suggested but Nothing is printing out and I think that that means there is an error somewhere that is crashing the entire thing... This is killing me... Thanks for all of your help... i'm going to stay up all night tonight and stress over it so if anyone can help at all please let me know!!
  4. I changed some stuff... it still isn't working... it must have been a PHP error because it was not even getting to the MySQL statements... Here is the code now... <?php //Error Reporting On ini_set('display_errors','on'); error_reporting(E_ALL ^ E_NOTICE); $Remove = $_POST[removeAID]; include("config.php"); if (!($db = mysql_pconnect($hostname, $username , $password))){ die("Can't connect to database server."); }else{ // select a database if (!(mysql_select_db("$database",$db))){ die("Can't connect to database."); } } $sql = "DELETE FROM `Assignment` WHERE `AssignmentID` = '$Remove'"; mysql_query($sql) or die(mysql_error().' - '.$sql); header("Location: MyURL");"); exit; ?> Here is the Form... <form action="NewAssignment3.php" method="post"> <table width = "100%" border="5"> <tr> <td width="33%" align="center"> Remove At Assignment ID</td> <td width="33%" align="center"><input type="text" size="10" name="removeAID"></td> <td width="33%" align="center"><input type="submit" /> </tr> </table> </form>
  5. This page is being called up when i submit a form from another page... and aid is being sent from that form
  6. Same... no Errors, No Remove, Nothing... White page
  7. Shoulda Seen that... now I am getting You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
  8. I have found that if there is an error anywhere in the page the page will come up blank it sounds like that is what is happening... i've found that this could be ANY error.
  9. Ok I moved the Redirect to the end of the page and now it is not redirecting and it is just a plain white page.
  10. I am not getting the Rows deleted when i do this? <?php header("Location: URL where I want it redirected"); $aid=$_POST[aid]; $aName=$_POST[aName]; $sid=$_POST[sid]; $description=$_POST[description]; include("configuration.php"); if (!($db = mysql_pconnect($hostname, $username , $password))){ die("Can't connect to database server."); }else{ // select a database if (!(mysql_select_db("$database",$db))){ die("Can't connect to database."); } } $sql = "DELETE FROM Assignment WHERE AssignmentID = $aid"; mysql_query($sql); or die(mysql_error()); ?>
  11. http://www.reaper-x.com/2007/06/27/mysql-installation-and-configuration-setting-up-private-wow-server/ the guy on number 61 is having the same problem... i am finishing up my lunch and need to get back to work but there may be an answer on there!
  12. Thank you all for all of you help... I finally figured it out it was a pain but i found it on ScriptPlayground here is the code for future people looking for this!! <?php include("config.php"); if (!($db = mysql_pconnect($hostname, $username , $password))){ die("Can't connect to database server."); }else{ // select a database if (!(mysql_select_db("$database",$db))){ die("Can't connect to database."); } } function display_db_query($query_string, $header_bool, $table_params) { // perform the database query $result_id = mysql_query($query_string) or die("display_db_query:" . mysql_error()); // find out the number of columns in result $column_count = mysql_num_fields($result_id) or die("display_db_query:" . mysql_error()); // Here the table attributes from the $table_params variable are added print("<TABLE $table_params >\n"); // optionally print a bold header at top of table if ($header_bool) { print("<TR>"); for ($column_num = 0; $column_num < $column_count; $column_num++) { $field_name = mysql_field_name($result_id, $column_num); print("<TH>$field_name</TH>"); } print("</TR>\n"); } // print the body of the table while ($row = mysql_fetch_row($result_id)) { print("<TR ALIGN=LEFT VALIGN=TOP>"); for ($column_num = 0; $column_num < $column_count; $column_num++) { print("<TD>$row[$column_num]</TD>\n"); } print("</TR>\n"); } print("</TABLE>\n"); } function display_db_table($tablename, $header_bool, $table_params) { $query_string = "SELECT * FROM $tablename"; display_db_query($query_string,$header_bool, $table_params); } ?> <TABLE border="2"> <TR> <TD> <?php //In this example the table name to be displayed is static, but it could be taken from a form $table = $assignmentTable; display_db_table($table, $global_dbh, TRUE, "border='0'"); ?> </TD> </TR> </TABLE> </body> </html>
  13. I went through and did some debugging the old fashion way and it looks like I cannot split up a table in between echo statments
  14. This is now my code... Still White Screen... I am used to programming in C# where when there is a problem you can step through it and find where it is not doing what it is supposed to... This is the Reason I should stay with my Windows Forms Programming haha <?php include("config.php"); if (!($db = mysql_pconnect($hostname, $username , $password))){ die("Can't connect to database server."); }else{ // select a database if (!(mysql_select_db("$database",$db))){ die("Can't connect to database."); } } $result = mysql_query("SELECT * FROM Assignment"); $num_rows = mysql_num_rows($result); $i = 0; echo"<table width="100%" border="0">"; echo"<tr> <td>$nbsp;</td> <td>Assignment ID</td> <td>Title</td> <td>School ID</td> <td>Description</td> </tr>"; while($row = mysql_fetch_array($result)) { $query = "Select * from Assignment where AssnID = '$i'"; $result = mysql_query($query); echo" <tr> <td>$nbsp;</td> <td>$row['Assignment']</td> <td>$row['Title']</td> <td>$row['SchoolID']</td> <td>$row['Description']</td> </tr> "; $i++ } echo"</table>"; ?>
  15. My column names are not numbers they are id schoolit assnid etc. I was doing the numbers as in first thing in the array... 2nd in the array... 3rd and so on. I changed it to the column names and still nothing
  16. I will take the first Query out... I am getting a blank white page...
  17. Here is my code... Configuration.php has all the variables for Database Hostname username password... I know the connection works.. <?php include("configuration.php"); if (!($db = mysql_pconnect($hostname, $username , $password))){ die("Can't connect to database server."); }else{ // select a database if (!(mysql_select_db("$database",$db))){ die("Can't connect to database."); } } $result = mysql_query("SELECT * FROM Assignment"); $num_rows = mysql_num_rows($result); $i = 0; echo"<table width="100%" border="0">"; echo"<tr> <td></td> <td>Assignment ID</td> <td>Title</td> <td>School ID</td> <td>Description</td> </tr>"; while($i < $num_rows+1) { $query = "Select * from Assignment where AssnID = $i"; $result = mysql_query($query); $row = mysql_fetch_array($result); echo" <tr> <td>$row[1]</td> <td>$row[2]</td> <td>$row[3]</td> <td>$row[4]</td> </tr> "; } echo"</table>"; ?> Thanks in advanced!!
×
×
  • 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.