kessels1234
Members-
Posts
19 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
kessels1234's Achievements
Newbie (1/5)
0
Reputation
-
Hi, First let's say I'm a beginner in php . The way you do it now : Assume that a password == mysecretpassword You ask the database if mysecretpassword exists with a given username. Ofcourse this doesn't exist because the first time (when registered on the website or application) you converted the given password to a MD5 and that's what's in the database Something like:h35dfg78766df5f7d8d8f6 So when you want to compare this you have to convert the given password again to md5 $password = $_POST['password']; Should be something like this : $password = md5($_POST['password']); Hope it helps Danny
-
The reason I want a real unique number is that I think that it is nobodies business to see(count) how much business we're doing on the repairs. We do repairs for customers on a regular basis. So one customer can come back 2 or 3 times within a month. If you have a simple increment by 1 a customer can see how much repairs we had since his last visit. This is not a welcome situation and that's the reason why I need a unique number. Hope this clears the questions and if anyone has some good alternatives I'd love to hear them. Thanks, Danny
-
Thanks for all the help. inversesoft123: I (partially) see what you mean but I don't know how to implement this (further)(still newbee who's learning) Solution I came up for now =: $maxsql = "SELECT MAX(repair_id) FROM repair"; $maxresult = mysql_query($maxsql); $maxrow = mysql_fetch_assoc($maxresult); $max_id = $maxrow['MAX(repair_id)']; Get the latest repair_id in the database and $order_num = date("Ymds"); $order_num .= $max_id; to create the ordernumber and then store it in the database with all the rest of the formdetails. Love to have comment on this. Thanks Danny
-
Hi, Does anyone know a good way to create a good ordernumber. I have a table with a record: order_num I want it to be a reasonable number. I know I could do something like this: $order_num .= date("Ymdhis"); But this returns a much too long number. I guess what I want is something like this: year+month+day+number number should be incremented by, let's say 5 Example ordernumber should look like this: 2010030115 and the next ordernumber should be 2010030120 so in the database there shoul be a lookup on the last ordernumber. Any ideas? Hope this story makes sense. Thanks in advance Danny
-
Thanks for the reply. I guess it is just a matter of opinion than. About safer feelings: The main goal is to delete all records related to the customer and that is what this does. Multiple ways lead to Rome........ SOLVED
-
Hi, thanks for your help. I got it working and the final sql statement = $repairsql = "DELETE klanten, repair FROM klanten LEFT JOIN repair ON klanten.klant_id=repair.klant_id WHERE klanten.klant_id = ".$validid.";"; jl5501:Why wouldn't it be a good idea to do it this way? Thanks again everyone
-
Hi, I want to perform a delete on multiple records from different tables. I have a table called KLANTEN(=customers) and I have a table called REPAIR: A customer can have more than 1 repairs. So when I delete a customer, also all repairs should be deleted to. My tables: 1. KLANTEN klant_id title firstname lastname etc....... 2. REPAIR repair_id klant_id instrument etc..... I though that following sql statement would do the job but obvious it doesn't case "klant": $repairsql = "DELETE FROM klant LEFT JOIN repair ON klant.klant_id=repair.klant_id WHERE klant_id = ".$validid.";"; mysql_query($repairsql); if (!$repairsql){ echo "Gegevens niet verwijderd"; } else{ header("Location: ".$livesite. "/admin/klant_list.php"); } break; I get the $validid through the url via a $_GET What am I doing wrong? Thanks for your help in advance. Danny
-
Thankx, I'm gonna check it out Danny
-
Don't really get what you mean by this. If you have some example code to demonstrate what you mean I can try to figure out. Thanks again for your help, Danny
-
OK found it. The header refresh was inside a function and I think that must have been the problem. I replaced it and now it works Thanks for the help Danny
-
The variable $validid is coming from a $_GET if (isset($_GET['klant_id']) == TRUE) { if (is_numeric($_GET['klant_id']) == FALSE) { $error = 1; } if ($error == 1) { header("Location: ".$config_basedir); } else { $validid = $_GET['klant_id']; } } This can't be the problem because where ever I echo out this $validid on the page it gives me the right result
-
Hi Wildteen88 I tries that but that doesn't work header("Refresh: 1; URL=klant_actions.php?klant_id=$validid"); that gives me in the url: klant_actions.php?klant_id= Any other suggestions?
-
Hi, Hope someone can help: I want to use the header refresh with a dynamic url. What I want is to redirect to klant_actions.php?klant_id=$validid The problem is with the $validid. It doesn't show up in the url. It is probably a formating problem but I can't seem to solve it by myself. I tried this: $returnurl = "klant_action.php?klant_id=$validid"; and then something like this: header('Refresh: 1; URL='.$returnurl); When I echo the $returnurl it gives me the correct url header('Refresh: 1; URL=klant_actions?klant_id=$validid'); this gives me an empty value in the url Any ideas? Thanks in advance Danny
-
Hi zanus, I'm trying to figure out what your code does. As soon as the for loop comes it gives me a blank screen (no errors). for($i = 0; $testdata = mysql_fetch_assoc($testresult); $i++) { if($testdata['m'] == "January") echo ($i>0) ? "</tr><tr>$monthsTR</tr><tr>\n" : "<tr>$monthsTR</tr><tr>\n"; echo "<td>$testdata['total']</td>"; } this code: if($testdata['m'] == "January") is ofcourse wrong because Januari doesn't exist. Whatever I try to do to correct this, it keeps giving a blank screen. Thanks for taking the time to help me with this. Really appreciate it.
-
Any idea of an example on how the sql and the code should look like?