Jump to content

Centrek

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Centrek's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. DocSeuss: Thank you very much for your help, it did take me another couple days of tinkering, and a lot of thinking, but it got it! I\'m pretty happy! There are a few things that i\'d like to be a bit different, but this does what it needs to for now! Thanks!
  2. i\'m really confused now! while trying to debug a bit, i tried to change the following around: $temp = \'<option value=\"\' . $num . \'\">%n</option>\'; $temp = \'<option value=\" \">%n</option>\'; produces the Names in the list $temp = \'<option value=\" \">%i</option>\'; produces their ICQ #s in list $temp = \'<option value=\" \">$n</option>\'; shows nothing $temp = \'<option value=\" \">$i</option>\'; shows nothing $temp = \'<option value=\" \">%num</option>\'; shows their Names with \'um\' appended to them in the list I cannot get $num to show a value, even though I know it has one, least i think I know it has one.
  3. oh, can you help me out by showing me how i would do that?? i thought that if i said $num=$_POST[\'id\']; that it would pass to the isset($_POST[\'delete\']) what should i do here?
  4. elseif(isset($_POST[\'delete\'])) { mysql_query("DELETE FROM clients WHERE name=\'$num\'") or $error=true; if(isset($error)) { echo \'HRMMMM It\'s broken.<br><small>\' . mysql_error() . \'</small><br>\'; echo \'Click <a href="\' . $PHP_SELF . \'">HERE</a> to try again.\'; } else { echo \'This client has now been deleted. Let them try to find a better host!\'; } } echo \'<form name="clientForm" action="\' . $PHP_SELF . \'" method="POST"><font color ="336699" size="1" Font="Arial"><font face="Arial">\'; ?> <select name="selector" onchange="showIt()" size="1"> <option selected value="">-- Select A Client --</option> <?php $temp = \'<option value="\' . $num . \'">%n</option>\'; $max = mysql_fetch_array(mysql_query(\'SELECT MAX(id) FROM clients\')); $max = $max[\'MAX(id)\']+1; while($result = mysql_fetch_array(mysql_query(\'SELECT * FROM clients WHERE id<\' . $max . \' ORDER BY id DESC;\'))) { $n = $_POST[\'name\']; $e = $_POST[\'email\']; $a = $_POST[\'aim\']; $i = $_POST[\'icq\']; $s = $_POST[\'site\']; $l = date(\'F j Y\'); $num=$_POST[\'id\']; echo str_replace(Array(\'%n\', \'%e\', \'%a\', \'%i\', \'%s\', \'%l\'), Array($result[\'name\'], $result[\'email\'], $result[\'aim\'], $result[\'icq\'], $result[\'site\'], $result[\'listed\']), $temp); $max = $result[\'id\']; } ?> </select> I get the statement: This client has now been deleted. Let them try to find a better host! So it doesn\'t have an error, and thinks that it deletes it, but it doesn\'t.
  5. I\'m working on some code to create a DB of clients. Each client will be listed in a drop down list. The code for the list is just HTML.... $temp=\'<option value=\" \"> %n </option>\'; This puts all of the names in the list, but I need to be able to use the ID number so that I can delete it like this... mysql_query(\"DELETE FROM clients WHERE id=\'$num\'\") or $error=true; This is my code to get the information from the DB: while($result = mysql_fetch_array(mysql_query(\'SELECT * FROM clients WHERE id<\' . $max . \' ORDER BY id DESC;\'))) { $n = $_POST[\'name\']; $e = $_POST[\'email\']; $a = $_POST[\'aim\']; $i = $_POST[\'icq\']; $s = $_POST[\'site\']; $l = date(\'F j Y\'); $num=$_POST[\'id\']; echo str_replace(Array(\'%n\', \'%e\', \'%a\', \'%i\', \'%s\', \'%l\'), Array($result[\'name\'], $result[\'email\'], $result[\'aim\'], $result[\'icq\'], $result[\'site\'], $result[\'listed\']), $temp); $max = $result[\'id\']; } I know i need something in the quotes in the <option value\" \"> tag, but nothing I try works. Any help would be greatly appreciated!
  6. k, i\'ve wanted to know how to do this for quite some time now. I\'m gonna jump in here, hope someone can help us out.
×
×
  • 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.