Jump to content

xtiancjs

Members
  • Posts

    47
  • Joined

  • Last visited

    Never

Everything posted by xtiancjs

  1. Hi all, Am wondering how to sort my results on a page by a variable. My sql code now is this: mysql_select_db($database_broker, $broker); $query_brokers = "SELECT * FROM brokers"; $query_limit_brokers = sprintf("%s LIMIT %d, %d", $query_brokers, $startRow_brokers, $maxRows_brokers); $brokers = mysql_query($query_limit_brokers, $broker) or die(mysql_error()); $row_brokers = mysql_fetch_assoc($brokers); The variable I have written looks like this : $valrate1 = (($row_brokers['broker_rating']/$row_brokers['broker_num_votes'])+ ($row_brokers['broker_rating_two']/$row_brokers['broker_num_votes_two'])+ ($row_brokers['broker_rating_three']/$row_brokers['broker_num_votes_three']))/3; basically, i want to add an ORDER BY $valrate1 to the sql query, have tried a few different things with no luck. Am not sure where the variable code should go , any ideas would be great. xtian
  2. [!--quoteo(post=367264:date=Apr 21 2006, 02:30 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Apr 21 2006, 02:30 PM) [snapback]367264[/snapback][/div][div class=\'quotemain\'][!--quotec--] Change this: [code]<?php $url1 = $row_bprofile['broker_url']; if($url1 = "not null") { echo 'homepage:<a href="<?php echo $row_bprofile['broker_url']; ?>" target="_blank"> click here</a>'; } else {echo;} ?>[/code]to [code]<?php $url1 = $row_bprofile['broker_url']; if($url1 != "" && strlen($url) >= 6) {     echo "homepage: <a href=\"" . $row_bprofile['broker_url'] . "\" target=\"_blank\">click here</a>"; } ?>[/code] [/quote] thanks for replying guru, what happenned was the link doesn't show in any situation, will keep trying, if you can think of anything else cool, if not peace
  3. Hi , am having a little trouble with the following: I have a link that contains a url like this: homepage:<a href="<?php echo $row_bprofile['broker_url']; ?>" target="_blank"> click here</a> What I want to do is, if there is a value in the db for the url , display the link if there is no url value just leave the space empty. i tried <?php $url1 = $row_bprofile['broker_url']; if($url1 = "not null") { echo 'homepage:<a href="<?php echo $row_bprofile['broker_url']; ?>" target="_blank"> click here</a>' ; } else {echo ;} ?> I got lots of errors any ideas? xtian
  4. Hi, I have a form that users vote with, The voting is limited to once per ip address, this is great for individuals but in a network situation only one computer seems able to vote. I would have used sessions and/or cookies but my client doesn't want to have any user Auth features, i figured ip restriction was the way to go, to get the ip address I used $_SERVER['REMOTE_ADDR']; Does anyone have any advice/suggestions xtian
  5. Hi all, I have a field in my table that requires a default value of 2.5, The field is a basic int field, in phpmy admin when I put the default value at 2.5, upon save it automatically rounds down to a 2, can anybody help me with this. I'm sure I am missing something obvious xtian
  6. [!--quoteo(post=360768:date=Apr 1 2006, 08:13 PM:name=xtiancjs)--][div class=\'quotetop\']QUOTE(xtiancjs @ Apr 1 2006, 08:13 PM) [snapback]360768[/snapback][/div][div class=\'quotemain\'][!--quotec--] Thanks for the quick reply, I have attempted a few things , I had enclosed everything in only one <?php ?>, and was having trouble with my form,thanks again ,will try it out xtian [/quote] Hi , just intergrated your suggestion Ken, it worked like a charm, out of general interest here is the final code I used [code]<td><?php $vipone = $_SERVER['REMOTE_ADDR'];                $viponeq = mysql_query("SELECT ip FROM voter_ip WHERE ip = '$vipone'");                if ($viponeq == '0') { ?>             <form method="post" name="form1" action="<?php echo $editFormAction; ?>">                 <table align="center">                   <tr valign="baseline">                     <td nowrap align="right"><select name="broker_rating" onClick="DoSubmission1();">                         <?php do {   ?>                         <option value="<?php echo $row_valueset['value']?>"<?php if (!(strcmp($row_valueset['value'], $row_bprofile['broker_rating']))) {echo "selected=\"selected\"";} ?>><?php echo $row_valueset['value']?></option>                         <?php } while ($row_valueset = mysql_fetch_assoc($valueset));   $rows = mysql_num_rows($valueset);   if($rows > 0) {       mysql_data_seek($valueset, 0);       $row_valueset = mysql_fetch_assoc($valueset);   } ?>                       </select></td>                     <td></td>                   <tr>                 </table>                 <input type="hidden" name="id" value="<?php echo $row_bprofile['id']; ?>">                 <input type="hidden" name="broker_num_votes" value="<?php echo $row_bprofile['broker_num_votes']; ?>">                 <input type="hidden" name="MM_update" value="form1">                 <input type="hidden" name="id" value="<?php echo $row_bprofile['id']; ?>">                 <input type="hidden" name="ip" value="<?php echo($_SERVER['REMOTE_ADDR']); ?>">                 <input type="hidden" name="page" value="<?php echo($_SERVER['REQUEST_URI']); ?>">                 <input type="hidden" name="MM_insert" value="form1">               </form><?php } else echo "You have already voted!<br>\n"; ?></td>[/code] thanks again
  7. [!--quoteo(post=360766:date=Apr 1 2006, 08:06 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Apr 1 2006, 08:06 PM) [snapback]360766[/snapback][/div][div class=\'quotemain\'][!--quotec--] Have you tried anything yet? Something like this should work: [code]<?php if ($variable == 'o') { ?> <form ...> </form> <?php } else echo "some message to the user<br>\n"; ?>[/code] Ken [/quote] Thanks for the quick reply, I have attempted a few things , I had enclosed everything in only one <?php ?>, and was having trouble with my form,thanks again ,will try it out xtian
  8. Hi all, I am trying to write a hopefully simple if else statement that would be something like this psuedo code if $variable = o display <form>form content</form> else echo"some message to the user" not quite sure how I would write that. xtian
  9. [!--quoteo(post=360445:date=Mar 31 2006, 02:03 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Mar 31 2006, 02:03 PM) [snapback]360445[/snapback][/div][div class=\'quotemain\'][!--quotec--] Yes you can you just have to make another query to the database after your other query. I believe this is your query:[code] $updateSQL = sprintf("UPDATE brokers SET broker_rating= broker_rating + %s, broker_num_votes=%s + 1 WHERE id=%s", GetSQLValueString($_POST['broker_rating'], "int"), GetSQLValueString($_POST['broker_num_votes'], "int"), GetSQLValueString($_POST['id'], "int")); mysql_select_db($database_broker, $broker); $Result1 = mysql_query($updateSQL, $broker) or die(mysql_error());[/code]After [i]GetSQLValueString($_POST['id'], "int"));[/i] do your secound query to log the users IP address. [/quote] Thanks for the reply, that is a big help as I wasn't sure where to start my next query from, will give it a shot thanks again xtian
  10. Hi all, I have a form which updates values in a dB table, is it possible from the same form to also insert a value into a different table? I just want to log the form users ip address with $_server['REMOTE_ADDR']; and use that ip later to limit form submission Here is my form code: form method="post" name="form2" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right"><select name="broker_rating_two" onClick="DoSubmission2();"> <?php do { ?> <option value="<?php echo $row_valueset2['value']?>" <?php if (!(strcmp($row_valueset2['value'], $row_bprofile['broker_rating_two']))) {echo "SELECTED";} ?>><?php echo $row_valueset2['value']?></option> <?php } while ($row_valueset2 = mysql_fetch_assoc($valueset2)); ?> </select></td> <td></td> <tr> </table> <input type="hidden" name="id" value="<?php echo $row_bprofile['id']; ?>"> <input type="hidden" name="broker_num_votes_two" value="<?php echo $row_bprofile['broker_num_votes_two']; ?>"> <input type="hidden" name="MM_update" value="form2"> <input type="hidden" name="id" value="<?php echo $row_bprofile['id']; ?>"> </form> HERE IS MY FORM ACTION CODE: $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE brokers SET broker_rating= broker_rating + %s, broker_num_votes=%s + 1 WHERE id=%s", GetSQLValueString($_POST['broker_rating'], "int"), GetSQLValueString($_POST['broker_num_votes'], "int"), GetSQLValueString($_POST['id'], "int")); mysql_select_db($database_broker, $broker); $Result1 = mysql_query($updateSQL, $broker) or die(mysql_error()); } APOLS FOR ALL THE CODE Xtian
  11. Hi all, I have a form which updates values in a dB table, is it possible from the same form to also insert a value into a different table? I just want to log the form users ip address with $_server['REMOTE_ADDR']; and use that ip later to limit form submission Here is my form code: form method="post" name="form2" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right"><select name="broker_rating_two" onClick="DoSubmission2();"> <?php do { ?> <option value="<?php echo $row_valueset2['value']?>" <?php if (!(strcmp($row_valueset2['value'], $row_bprofile['broker_rating_two']))) {echo "SELECTED";} ?>><?php echo $row_valueset2['value']?></option> <?php } while ($row_valueset2 = mysql_fetch_assoc($valueset2)); ?> </select></td> <td></td> <tr> </table> <input type="hidden" name="id" value="<?php echo $row_bprofile['id']; ?>"> <input type="hidden" name="broker_num_votes_two" value="<?php echo $row_bprofile['broker_num_votes_two']; ?>"> <input type="hidden" name="MM_update" value="form2"> <input type="hidden" name="id" value="<?php echo $row_bprofile['id']; ?>"> </form> HERE IS MY FORM ACTION CODE: $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE brokers SET broker_rating= broker_rating + %s, broker_num_votes=%s + 1 WHERE id=%s", GetSQLValueString($_POST['broker_rating'], "int"), GetSQLValueString($_POST['broker_num_votes'], "int"), GetSQLValueString($_POST['id'], "int")); mysql_select_db($database_broker, $broker); $Result1 = mysql_query($updateSQL, $broker) or die(mysql_error()); } APOLS FOR ALL THE CODE Xtian
  12. Hi all, am trying to figure out a way for a user to submit a form only once, am trying to use an alternative to a javascript disable submit. I know I am being picky but I need this change to be permanent so a session won't work. I also realise that if cookies are turned off then that would not be ideal either. I think what I need to do is store the users ip somewhere and be able to reference it if the user tries to send the form again. Could someone point me in the right direction? My form is a drop down jump menu which calls a javascript to do the submission when an option is pointed to, MY FORM: <form method="post" name="form1" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right"><select name="broker_rating" onClick="DoSubmission1();"> <?php do { ?> <option value="<?php echo $row_valueset['value']?>"<?php if (!(strcmp($row_valueset['value'], $row_bprofile['broker_rating']))) {echo "selected=\"selected\"";} ?>><?php echo $row_valueset['value']?></option> <?php } while ($row_valueset = mysql_fetch_assoc($valueset)); $rows = mysql_num_rows($valueset); if($rows > 0) { mysql_data_seek($valueset, 0); $row_valueset = mysql_fetch_assoc($valueset); } ?> </select></td> <td></td> <tr> </table> <input type="hidden" name="id" value="<?php echo $row_bprofile['id']; ?>"> <input type="hidden" name="broker_num_votes" value="<?php echo $row_bprofile['broker_num_votes']; ?>"> <input type="hidden" name="MM_update" value="form1"> <input type="hidden" name="id" value="<?php echo $row_bprofile['id']; ?>"> </form> FORM ACTION CODE: $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE brokers SET broker_rating= broker_rating + %s, broker_num_votes=%s + 1 WHERE id=%s", GetSQLValueString($_POST['broker_rating'], "int"), GetSQLValueString($_POST['broker_num_votes'], "int"), GetSQLValueString($_POST['id'], "int")); mysql_select_db($database_broker, $broker); $Result1 = mysql_query($updateSQL, $broker) or die(mysql_error()); } Hope this code helps, thanks xtian
  13. [!--quoteo(post=356762:date=Mar 20 2006, 03:57 PM:name=earl_dc10)--][div class=\'quotetop\']QUOTE(earl_dc10 @ Mar 20 2006, 03:57 PM) [snapback]356762[/snapback][/div][div class=\'quotemain\'][!--quotec--] haha, yeah, I guess that puts me in my place ;) I guess I should've noted where in the script I was placing it! Thanks for your inputs! [/quote] Hi, I had exaclty the same problem, except everything worked great in firefox mac and but ie win needed a second refresh, xtian
  14. [!--quoteo(post=356565:date=Mar 19 2006, 09:44 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Mar 19 2006, 09:44 PM) [snapback]356565[/snapback][/div][div class=\'quotemain\'][!--quotec--] It's printing out a number because in your first line you have [code]<?php echo $num = $row_bprofile['broker_rating']/$row_bprofile['broker_num_votes']; ?>[/code] Remove that "[b][!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]echo[!--colorc--][/span][!--/colorc--][/b]" and that should get rid of the number. Ken [/quote] Thanks for all the help there Ken and Co. Everything seems to be working smoothly, will be hammering away again tonight at this beast called php/mysql cheers xtian
  15. [!--quoteo(post=356552:date=Mar 19 2006, 08:49 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Mar 19 2006, 08:49 PM) [snapback]356552[/snapback][/div][div class=\'quotemain\'][!--quotec--] I think you copied you code incorrectly ... you're using the same image nomatter what the value of $num is. Please post the code you really want us to look at. For the previous poster: If the OP is using UNIX or Linux, files can have multiple dots with no problems and can start with numbers. Ken [/quote] So Sorry, I was staring at that thing for ever, you were right, I did however rename the images in a better way, it now almost works, my problem is now it still shnows the numeric value above the graphic?? anyway thanks for your help xtian
  16. Hi, I need help with the following piece of code, thanks to hitman for steering me in the right direction, basically ,depending on the result of $num i am trying to get the correct image to display, can anybody help to see why my image doesn't display, just the numerical value. [!--coloro:#333399--][span style=\"color:#333399\"][!--/coloro--]<?php echo $num = $row_bprofile['broker_rating']/$row_bprofile['broker_num_votes']; if ($num > 0 && $num <= .5) { echo '<img src="images/0.5_dark.png">'; } else if ($num > .5 && $num <= 1) { echo '<img src="images/0.5_dark.png">'; } else if ($num > 1 && $num <= 1.5) { echo '<img src="images/0.5_dark.png">'; } else if ($num > 1.5 && $num <= 2) { echo '<img src="images/0.5_dark.png">'; } else if ($num > 2 && $num <= 2.5) { echo '<img src="images/0.5_dark.png">'; } else if ($num > 2.5 && $num <= 3) { echo '<img src="images/0.5_dark.png">'; } else if ($num > 3 && $num <= 3.5) { echo '<img src="images/0.5_dark.png">'; }else if ($num > 3.5 && $num <= 4) { echo '<img src="images/0.5_dark.png">'; }else if ($num > 4 && $num <= 4.5) { echo '<img src="images/0.5_dark.png">'; }else { echo '<img src="images/0.5_dark.png">'; } ?>[!--colorc--][/span][!--/colorc--] thanks xtian
  17. [!--quoteo(post=356461:date=Mar 19 2006, 02:54 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Mar 19 2006, 02:54 PM) [snapback]356461[/snapback][/div][div class=\'quotemain\'][!--quotec--] Unless I'm misunderstanding, your wanting something like: [code]$num = $row_bprofile['broker_rating']/$row_bprofile['broker_num_votes']; if ($num > 0 && $num <= .1) {   echo '<img src="10percent.jpg">'; } else if ($num > .1 && $num <= .2) {   echo '<img src="20percent.jpg">'; }   and so on.......[/code] [/quote] thanks for the reply, I'll give it a shot!!! Xtian
  18. Hi, I have a result from the division of 2 fields from my DB. what I want to achieve is to display this result as an image, the image displayed would depend on the result. this is the code that displays the result - [!--coloro:#6600CC--][span style=\"color:#6600CC\"][!--/coloro--]<?php echo $row_bprofile['broker_rating']/$row_bprofile['broker_num_votes']; ?>[!--colorc--][/span][!--/colorc--] and this is the code from the original update query - [!--coloro:#333399--][span style=\"color:#333399\"][!--/coloro--]$updateSQL = sprintf("UPDATE brokers SET broker_rating= broker_rating + %s, broker_num_votes=%s + 1 WHERE id=%s"[!--colorc--][/span][!--/colorc--] right now this displays some nasty huge decimal number, can anybody help me with this? thanks xtian
  19. Hi, I have a table named brokers and am trying to add numbers from a menu to an existing number in a field named value_votes . I tried it with the UPDATE command in sql but this just replaced my old number not added to it. I know I need to do something along these lines: UPDATE brokers SET value_votes WHERE value_votes = existing number + new number from form , that last little bit is over my head, can anybody help me with that syntax xtian
  20. problem solved, my recordset was incorrect, I took out the second recordset and simplified the first one to SELECT brokers.info, comments.comment FROM brokers, comments WHERE brokers.broker_id = comments.broker_id
  21. Hi am still having a little trouble with viewing my comments from the DB. I have 2 tables brokers and comments, I have managed I think to link the primary id of one table(brokers)to a foreign key of the other table(comments). when a user adds a comment from the form it stores in the DB and is assigned an id that is the same as the brokers primary id. The problem is arising from viewing the comments, ALL the comments are still being viewed on each page, I now have a WHERE statement in my recordset and was hoping that would fix it . you can view my example at [a href=\"http://slazo.com/brokerrate/pages/profile.php\" target=\"_blank\"]http://slazo.com/brokerrate/pages/profile.php[/a] here is all the code (sorry for the huge chunk of code-not sure what would be needed): The code is dreamweaver 8 code: <?php require_once('../../../Connections/broker.php'); ?> <?php $currentPage = $_SERVER["PHP_SELF"]; function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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; } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO comments (broker_id, comment) VALUES (%s, %s)", GetSQLValueString($_POST['broker_id'], "int"), GetSQLValueString($_POST['comment'], "text")); mysql_select_db($database_broker, $broker); $Result1 = mysql_query($insertSQL, $broker) or die(mysql_error()); } $maxRows_brokers = 1; $pageNum_brokers = 0; if (isset($_GET['pageNum_brokers'])) { $pageNum_brokers = $_GET['pageNum_brokers']; } $startRow_brokers = $pageNum_brokers * $maxRows_brokers; mysql_select_db($database_broker, $broker); $query_brokers = "SELECT * FROM brokers"; $query_limit_brokers = sprintf("%s LIMIT %d, %d", $query_brokers, $startRow_brokers, $maxRows_brokers); $brokers = mysql_query($query_limit_brokers, $broker) or die(mysql_error()); $row_brokers = mysql_fetch_assoc($brokers); if (isset($_GET['totalRows_brokers'])) { $totalRows_brokers = $_GET['totalRows_brokers']; } else { $all_brokers = mysql_query($query_brokers); $totalRows_brokers = mysql_num_rows($all_brokers); } $totalPages_brokers = ceil($totalRows_brokers/$maxRows_brokers)-1; $maxRows_comments = 3; $pageNum_comments = 0; if (isset($_GET['pageNum_comments'])) { $pageNum_comments = $_GET['pageNum_comments']; } $startRow_comments = $pageNum_comments * $maxRows_comments; mysql_select_db($database_broker, $broker); $query_comments = "SELECT * FROM comments, brokers WHERE comments.broker_id = brokers.broker_id"; $query_limit_comments = sprintf("%s LIMIT %d, %d", $query_comments, $startRow_comments, $maxRows_comments); $comments = mysql_query($query_limit_comments, $broker) or die(mysql_error()); $row_comments = mysql_fetch_assoc($comments); if (isset($_GET['totalRows_comments'])) { $totalRows_comments = $_GET['totalRows_comments']; } else { $all_comments = mysql_query($query_comments); $totalRows_comments = mysql_num_rows($all_comments); } $totalPages_comments = ceil($totalRows_comments/$maxRows_comments)-1; $queryString_brokers = ""; if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_brokers") == false && stristr($param, "totalRows_brokers") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_brokers = "&" . htmlentities(implode("&", $newParams)); } } $queryString_brokers = sprintf("&totalRows_brokers=%d%s", $totalRows_brokers, $queryString_brokers); ?><!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=ISO-8859-1" /> <title>Untitled Document</title> </head> <body> <p>Broker Profile</p> <table width="100%" border="0"> <tr> <td colspan="2"><?php echo $row_brokers['info']; ?></td> </tr> <tr> <td width="75%"> <table border="0" width="50%" align="left"> <tr> <td width="23%" align="center"><?php if ($pageNum_brokers > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_brokers=%d%s", $currentPage, 0, $queryString_brokers); ?>">First</a> <?php } // Show if not first page ?> </td> <td width="31%" align="center"><?php if ($pageNum_brokers > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_brokers=%d%s", $currentPage, max(0, $pageNum_brokers - 1), $queryString_brokers); ?>">Previous</a> <?php } // Show if not first page ?> </td> <td width="23%" align="center"><?php if ($pageNum_brokers < $totalPages_brokers) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_brokers=%d%s", $currentPage, min($totalPages_brokers, $pageNum_brokers + 1), $queryString_brokers); ?>">Next</a> <?php } // Show if not last page ?> </td> <td width="23%" align="center"><?php if ($pageNum_brokers < $totalPages_brokers) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_brokers=%d%s", $currentPage, $totalPages_brokers, $queryString_brokers); ?>">Last</a> <?php } // Show if not last page ?> </td> </tr> </table></td> <td width="25%"> </td> </tr> </table> <p>Comments</p> <?php do { ?> <table width="100%" border="0"> <tr> <td colspan="2"><?php echo $row_comments['comment']; ?></td> </tr> <tr> <td> </td> <td> </td> </tr> </table> <?php } while ($row_comments = mysql_fetch_assoc($comments)); ?><p>Add a comment:</p> <p> </p> <form method="post" name="form1" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">Comment:</td> <td><textarea name="comment" cols="32"></textarea></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Insert record"></td> </tr> </table> <input name="broker_id" type="hidden" value="<?php echo $row_brokers['broker_id']; ?>"> <input type="hidden" name="MM_insert" value="form1"> </form> <p> </p> </html> <?php mysql_free_result($brokers); mysql_free_result($comments); ?> Thanks for any help!!!! xtian
  22. HI, am having some major trouble with this one. I have set up a user login system. The user id # is stored in a mysql DB. So far so good. The user has been given a "one use only" user #. When the user logs out, I want to be able to delete that particular users id # from the DB. This I have failed to do. Please help!!
×
×
  • 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.