Jump to content

KMC1499

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

KMC1499's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok no form tags and i added that code to me page buuuuuut im missing where the page actually updates the database. What i want to do is when the people click the update button have the page update the contacted field to Yes and reload the page this time without the contacts with yes in the contacted column (page will filter these out in the select query automatically)
  2. I plan on adding a where clause to my select so only my people who have "no" in the contacted field are shown. So i added the form tags to the code. <form action="update_script.php" method="get"> <tr> <TD ALIGN=CENTER ><?php echo $row_Recordset1['dateentered']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['firstname']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['lastname']; ?></td> <TD ALIGN=CENTER ><a href="mailto:<?php echo $row_Recordset1['email'];?>"><?php echo $row_Recordset1['email']; ?></a></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['mailaddress']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['city']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['state']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['zipcode']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['party']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['phone']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['transportation']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['travel']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['distance']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['class']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['pickup']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['dropoff']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['bilingual']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['contacted']; ?></td> <TD ALIGN=CENTER ><a href="update_script.php?<?php print $row_Recordset1['idjudge']; ?>">Update</a></td> </tr> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> </table> </form> </body> </html> <?php mysql_free_result($Recordset1); ?> And in my update script page i add the php info to update the record?
  3. I believe so i was just unsure how to go about it since im fairly new to php and i wasnt sure how to go about it. My idea was to create a form around each record that would have a "update" button on the end that would run a function that would update the database and reload the webpage. Sound good???
  4. It does have a primary key, this page was just used to pull all records. I could pull the primary key and not display it.
  5. <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } mysql_select_db($database_judges, $judges); $query_Recordset1 = "SELECT idjudge, firstname, lastname, email, mailaddress, city, state, zipcode, party, phone, transportation, travel, distance, class, pickup, dropoff, bilingual, dateentered, mysqldate, contacted FROM judge WHERE contacted='No' ORDER BY mysqldate ASC"; $Recordset1 = mysql_query($query_Recordset1, $judges) or die(mysql_error()); $row_Recordset1 = mysql_fetch_assoc($Recordset1); $totalRows_Recordset1 = mysql_num_rows($Recordset1); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Judges</title> </head> <body> <?php // Free memory //mysql_free_result($check); ?> <table border="1" style="border:1px solid black;"> <tr> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Signup Date</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>First Name</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Last Name</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Email Address</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Mailing Address</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>City</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>State</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Zipcode</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Party</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Phone Number</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Transportation</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Travel</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Distance</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Class</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Pickup</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Dropoff</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Bilingual</FONT></td> <TD BGCOLOR=#C7C5BC ALIGN=CENTER ><FONT style=FONT-SIZE:9pt FACE="Arial" COLOR=#f9f9f7>Contacted?</FONT></td> </tr> <?php do { ?> <tr> <TD ALIGN=CENTER ><?php echo $row_Recordset1['dateentered']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['firstname']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['lastname']; ?></td> <TD ALIGN=CENTER ><a href="mailto:<?php echo $row_Recordset1['email'];?>"><?php echo $row_Recordset1['email']; ?></a></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['mailaddress']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['city']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['state']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['zipcode']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['party']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['phone']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['transportation']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['travel']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['distance']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['class']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['pickup']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['dropoff']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['bilingual']; ?></td> <TD ALIGN=CENTER ><?php echo $row_Recordset1['contacted']; ?></td> </tr> <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?> </table> </body> </html> <?php mysql_free_result($Recordset1); ?> What we want to do is to be able to update each person as we contact them here is a picture showing the form online.
  6. First off thank you for opening my issue and taking the time out to try and help. I have created a php page that will display a list of people from a mysql database. What i would like to do is have a button that will update a field in the database when pressed. My question is if i make the fields into a form will it only update that one person?
  7. I was wondering if anyone had any success building their database in ms Access then convert it to Mysql. I downloaded a tool to do this for me (unless someone knows how to extract the database design in a text file). Is there anything that i should look out for? i have the mysql workbench but as of now i really familiar with it. i know practice practice lol I was doing this to simplify the database design (im already familiar with access) so i would have a GUI to show me all the tables i have and their relationships.
  8. Sorry this is line 56 i changed it to echo "You Chose"; echo $strname; echo $dblhour; echo $strLocation; which got rid of my error looks like somehow the code needs to be changed for some reason and this is where the learning curve kicks in! Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\phptest\equipment.php on line 62 line 62 echo Equipment ID $i=.$listvals[$i].<br>\n; well looks like i have some learning to do!
  9. heres a form i modified to have people reserve resources on our intranet i was going to have it connect to a mysql database in the future <HTML> <HEAD> <TITLE>Processing All Form Elements</TITLE> </HEAD> <BODY BGCOLOR=”#ffffff”> <FORM name=”frm_Example” action=”allformelements.php” method=”post”> <table border=”0” cellpadding=”2” cellspacing=”0”> <tr> <td align=”left” valign=”top”><b>Your Name?</b></td> <td align=”left” valign=”top”><input type=”text” name=”strname”></td> </tr> <tr> <td align=”left” valign=”top”><b>Hours Needed</b></td> <td align=”left” valign=”top”> <select name=”dblhour”> <option value=”1”>1</option> <option value=”2”>2</option> <option value=”3”>3</option> </select> </td> </tr> <tr> <td align=”left” valign=”top”><b>Confrence room needed</b></td> <td align=”left” valign=”top”> <input type=”radio” name=”strLocation” value=”Main”>main <input type=”radio” name=”strLocation” value=”Glass” checked>Glass <input type=”radio” name=”strLocation” value=”Creative”>Creative </td> </tr> <tr> <td align=”left” valign=”top”><b>Equipment</b></td> <td align=”left” valign=”top”> <input type=”checkbox” name=”nEquipmentID[]” value=”1” checked>Projector <input type=”checkbox” name=”nEquipmentID[]” value=”2” checked>Speakers <input type=”checkbox” name=”nEquipmentID[]” value=”3” checked>Microphone </td> </tr> <tr> <td align=”left” valign=”top” colspan=”2”><input type=”submit” value=”Submit”></ td> </tr> </table> </FORM> <?php if($_POST) { $strname = $_POST[‘strname’]; $dblhour = $_POST[‘dblhour’]; $strLocation = $_POST[‘strLocation’]; echo=(You Chose <br> $strname <br> $dblhour <br> $strLocation <br>); $listvals = $_POST[‘nEquipmentID’]; for($i=0;$i<count($_POST[‘nEquipmentID’]);$i++) echo “Equipment ID $i=”.$listvals[$i].”<br>\n”; } ?> </BODY> </HTML> This did work but all i get now is: Parse error: syntax error, unexpected '=' in D:\phptest\equipment.php on line 56
  10. First off thanks for taking the time to help me figure this out. It started about a week ago. At first i was using notepad to edit the pages but then i switched to dreamweaver. All was fine until the site manager wizard came up and i went through that. I did enable server technology. After that i started getting the 500 errors on some of the pages that had previously been working. Even the scripts i get from my pdf and online sources are getting these errors. As you see in the other example the error was in the echo so i found an echo example to test the code and i found this script: <?php $my_string = "Hello Bob. My name is: "; $my_number = 4; $my_letter = a; echo $my_string; echo $my_number; echo $my_letter; ?> actual print out: Notice: Use of undefined constant a - assumed 'a' in D:\phptest\echo.php on line 4 Hello Bob. My name is: 4a i went back changed $my_number = 4; $my_letter = a; to $my_number = "4"; $my_letter = "a"; and it worked fine Since im new to the php code im not totally sure whats going on but argh! its annoying lol
  11. I understand what your saying but this is happening with alot of code even the stuff im getting straight from the book im trying to learn from. It all worked before.
  12. Im in need of some help, im trying to learn more about php and iis. I have a simple site on a win 2k3 server. everything was going fine until dreamweaver asked about being the site manager and boom most of my php stuff isnt working anymore. I checked the see if what verbs i was allowing and its set to allow all on the site main and site levels. My php config page still comes up so php is working. This page worked before dreamweaver did its thing but now all i get is a 500 error when i try and access it <?php function square($num) { $num *= $num; return $num; } $someNum = 6; echo(Variable before going into the function = . $someNum); $results = square($someNum); echo(<br>Variable after going into the function = . $someNum . <br>Results of function = .$results); ?> here is what my log file says. #Fields: date time s-sitename s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) sc-status sc-substatus sc-win32-status 2008-10-09 18:13:31 W3SVC1 172.16.0.4 GET /numbers.php - 80 - 172.16.0.23 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.1;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.04506.648;+.NET+CLR+3.5.21022;+InfoPath.2) 500 0 0 I turned on the display errors and it reads: Parse error: syntax error, unexpected T_STRING in D:\phptest\numbers.php on line 8 It says thing similar to this on other php files i have that were working before. Any help would be greatly apprectiated, thanks.
×
×
  • 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.