Jump to content

rilana

Members
  • Posts

    157
  • Joined

  • Last visited

Everything posted by rilana

  1. Wow Thank you! This worked! Not sure yet how to get the data out of the arrays and put it into an excel that makes sense, but I will try to read up on it.
  2. Yes you are right, the dump now is much longer. And it converts some of the ü in ue and so on. My DB Connection looks like this. //connection to mysql mysql_connect("localhost", "", ""); //server , username , password mysql_select_db(""); //query get data $sql = mysql_query("SELECT * FROM wp_visual_form_builder_entries"); $no = 1; while($result = mysql_fetch_assoc($sql)){
  3. hi and thank you for your patience. I tryed to get the error log, but shared host-person was not available. I tryed a view things: 1. writing a txt File with your provided code «see attached» 2. realized it is not all the info like with echo «see attached file» 3. tryed to execute the provided code local on MAMP-Server «There was no txt File written and the ä ö ü where not set in utf8» I am grateful for your patience with me. data-new.txt echo.txt
  4. echo strlen($deserialized_array); gives out 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 echo mb_detect_encoding($deserialized_array); gives out ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII ASCII Your provided example also gives out ASCII.
  5. I did the ...... by hand. sorry. The Script I don't have within wordpress. The show Variables is not working. But i checked the database, it says longtext utf8_general_ci and wp config say's define('DB_CHARSET', 'utf8'); /** Der collate type sollte nicht geändert werden */ define('DB_COLLATE', ''); The data-field is created by a plugin called Visual Form Builder
  6. This is the first record of the db. serialized it buts out bool(false) a:11:{i:0;a:7:{s:2:"id";s:1:"1";s:4:"slug";s:1:"1";s:4:"name";s:0:"";s:4:"type";s:8:"fieldset";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:0:"";}i:1;a:7:{s:2:"id";s:1:"5";s:4:"slug";s:6:"anrede";s:4:"name";s:6:"Anrede";s:4:"type";s:6:"select";s:7:"options";s:36:"a:2:{i:0;s:4:"Herr";i:1;s:4:"Frau";}";s:9:"parent_id";s:1:"0";s:5:"value";s:4:"Frau";}i:2;a:7:{s:2:"id";s:1:"6";s:4:"slug";s:7:"vorname";s:4:"name";s:7:"Vorname";s:4:"type";s:4:"text";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:5:"Irene";}i:3;a:7:{s:2:"id";s:1:"7";s:4:"slug";s:8:"nachname";s:4:"name";s:8:"Nachname";s:4:"type";s:4:"text";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:8:"Oppliger";}i:4;a:7:{s:2:"id";s:3:"104";s:4:"slug";s:5:"firma";s:4:"name";s:5:"Firma";s:4:"type";s:4:"text";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:5:"OLAER";}i:5;a:7:{s:2:"id";s:3:"105";s:4:"slug";s:9:"abteilung";s:4:"name";s:9:"Abteilung";s:4:"type";s:4:"text";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:9:"Marketing";}i:6;a:7:{s:2:"id";s:2:"10";s:4:"slug";s:5:"email";s:4:"name";s:5:"Email";s:4:"type";s:5:"email";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:21:"i.oppliger@....ch";}i:7;a:7:{s:2:"id";s:1:"9";s:4:"slug";s:7:"sprache";s:4:"name";s:7:"Sprache";s:4:"type";s:6:"select";s:7:"options";s:67:"a:3:{i:0;s:7:"Deutsch";i:1;s:8:"Englisch";i:2;s:12:"Französisch";}";s:9:"parent_id";s:1:"0";s:5:"value";s:7:"Deutsch";}i:8;a:7:{s:2:"id";s:1:"2";s:4:"slug";s:1:"2";s:4:"name";s:0:"";s:4:"type";s:12:"verification";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:0:"";}i:9;a:7:{s:2:"id";s:1:"3";s:4:"slug";s:1:"3";s:4:"name";s:0:"";s:4:"type";s:6:"secret";s:7:"options";s:0:"";s:9:"parent_id";s:1:"2";s:5:"value";s:0:"";}i:10;a:7:{s:2:"id";s:1:"4";s:4:"slug";s:8:"anmelden";s:4:"name";s:8:"Anmelden";s:4:"type";s:6:"submit";s:7:"options";s:0:"";s:9:"parent_id";s:1:"2";s:5:"value";s:0:"";}}
  7. Oh I wished I could tell you what the pattern is, but I just dont see one. It seems like the first 42 Records have a bool(False) error. Below the output. bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) bool(false) array(21) { [0]=> array(7) { ["id"]=> string(3) "501" ["slug"]=> string(3) "501" ["name"]=> string(0) "" ["type"]=> string( "fieldset" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(0) "" } [1]=> array(7) { ["id"]=> string(3) "505" ["slug"]=> string(7) "contact" ["name"]=> string(7) "Contact" ["type"]=> string( "checkbox" ["options"]=> string(141) "a:4:{i:0;s:22:"Product documentations";i:1;s:28:"Attending a sales consultant";i:2;s:14:"Please call me";i:3;s:23:"I have another question";}" ["parent_id"]=> string(1) "0" ["value"]=> string(23) "I have another question" } [2]=> array(7) { ["id"]=> string(3) "506" ["slug"]=> string(10) "hydraulics" ["name"]=> string(10) "Hydraulics" ["type"]=> string( "checkbox" ["options"]=> string(278) "a:9:{i:0;s:22:"Hydraulic accumulators";i:1;s:17:"Coolers and pumps";i:2;s:15:"Cooling systems";i:3;s:15:"Air Oil Coolers";i:4;s:13:"Plate Coolers";i:5;s:32:"Active cooling systems / Chiller";i:6;s:26:"Enclosure air conditioning";i:7;s:17:"Hydraulic filters";i:8;s:8:"Services";}" ["parent_id"]=> string(1) "0" ["value"]=> string(22) "Hydraulic accumulators" } [3]=> array(7) { ["id"]=> string(3) "508" ["slug"]=> string(14) "other-products" ["name"]=> string(14) "Other products" ["type"]=> string(4) "text" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(0) "" } [4]=> array(7) { ["id"]=> string(3) "507" ["slug"]=> string(17) "water-waste-water" ["name"]=> string(19) "Water / Waste Water" ["type"]=> string( "checkbox" ["options"]=> string(400) "a:10:{i:0;s:28:"Calculations and simulations";i:1;s:31:"Service and maintenance on site";i:2;s:33:"Shock absorber for drinking water";i:3;s:30:"Shock absorber for waste water";i:4;s:36:"Pressure vessels / Expansion vessels";i:5;s:17:"Pulsation dampers";i:6;s:40:"Small dampers for sanitary installations";i:7;s:28:"Bleeder and degassing valves";i:8;s:16:"No return valves";i:9;s:14:"Other services";}" ["parent_id"]=> string(1) "0" ["value"]=> string(0) "" } [5]=> array(7) { ["id"]=> string(3) "509" ["slug"]=> string(14) "other-products" ["name"]=> string(14) "Other products" ["type"]=> string(4) "text" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(0) "" } [6]=> array(7) { ["id"]=> string(3) "510" ["slug"]=> string(16) "personal-remarks" ["name"]=> string(16) "Personal remarks" ["type"]=> string( "textarea" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(187) "We are bidding on a job that includes parts for accumulator units. Please advise who I should send my inquiry to. A quote is needed no later then 12-31 for us to meet the bid close date." } [7]=> array(7) { ["id"]=> string(3) "519" ["slug"]=> string(13) "personal-data" ["name"]=> string(13) "Personal data" ["type"]=> string( "fieldset" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(0) "" } [8]=> array(7) { ["id"]=> string(3) "511" ["slug"]=> string(7) "company" ["name"]=> string(7) "Company" ["type"]=> string(4) "text" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(13) "Teletec Corp." } [9]=> array(7) { ["id"]=> string(3) "512" ["slug"]=> string(10) "department" ["name"]=> string(10) "Department" ["type"]=> string(4) "text" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(10) "Purchasing" } [10]=> array(7) { ["id"]=> string(3) "513" ["slug"]=> string(10) "first-name" ["name"]=> string(10) "First name" ["type"]=> string(4) "text" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(5) "Diane" } [11]=> array(7) { ["id"]=> string(3) "514" ["slug"]=> string(7) "surname" ["name"]=> string(7) "Surname" ["type"]=> string(4) "text" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(6) "Hunter" } [12]=> array(7) { ["id"]=> string(3) "515" ["slug"]=> string(13) "street-adress" ["name"]=> string(13) "Street adress" ["type"]=> string(4) "text" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(26) "5617 Departure Dr. Ste 107" } [13]=> array(7) { ["id"]=> string(3) "516" ["slug"]=> string(15) "postal-codecity" ["name"]=> string(16) "Postal code/City" ["type"]=> string(4) "text" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(13) "Raleigh 27616" } [14]=> array(7) { ["id"]=> string(4) "1427" ["slug"]=> string(7) "country" ["name"]=> string(7) "Country" ["type"]=> string(4) "text" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(3) "USA" } [15]=> array(7) { ["id"]=> string(3) "517" ["slug"]=> string(6) "e-mail" ["name"]=> string(6) "E-Mail" ["type"]=> string(4) "text" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(30) "dhunter@teleteccorporation.com" } [16]=> array(7) { ["id"]=> string(3) "518" ["slug"]=> string(5) "phone" ["name"]=> string(5) "Phone" ["type"]=> string(4) "text" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(10) "9199547300" } [17]=> array(7) { ["id"]=> string(3) "520" ["slug"]=> string( "language" ["name"]=> string( "Language" ["type"]=> string(5) "radio" ["options"]=> string(58) "a:3:{i:0;s:6:"German";i:1;s:6:"French";i:2;s:7:"English";}" ["parent_id"]=> string(1) "0" ["value"]=> string(7) "English" } [18]=> array(7) { ["id"]=> string(3) "502" ["slug"]=> string(17) "security-question" ["name"]=> string(17) "Security question" ["type"]=> string(12) "verification" ["options"]=> string(0) "" ["parent_id"]=> string(1) "0" ["value"]=> string(0) "" } [19]=> array(7) { ["id"]=> string(3) "503" ["slug"]=> string(31) "please-enter-a-two-digit-number" ["name"]=> string(31) "Please enter a two-digit number" ["type"]=> string(6) "secret" ["options"]=> string(0) "" ["parent_id"]=> string(3) "502" ["value"]=> string(2) "12" } [20]=> array(7) { ["id"]=> string(3) "504" ["slug"]=> string(4) "send" ["name"]=> string(4) "Send" ["type"]=> string(6) "submit" ["options"]=> string(0) "" ["parent_id"]=> string(3) "502" ["value"]=> string(0) "" } } And the output with simple echo just part of it. a:11:{i:0;a:7:{s:2:"id";s:1:"1";s:4:"slug";s:1:"1";s:4:"name";s:0:"";s:4:"type";s:8:"fieldset";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:0:"";}i:1;a:7:{s:2:"id";s:1:"5";s:4:"slug";s:6:"anrede";s:4:"name";s:6:"Anrede";s:4:"type";s:6:"select";s:7:"options";s:36:"a:2:{i:0;s:4:"Herr";i:1;s:4:"Frau";}";s:9:"parent_id";s:1:"0";s:5:"value";s:4:"Frau";}i:2;a:7:{s:2:"id";s:1:"6";s:4:"slug";s:7:"vorname";s:4:"name";s:7:"Vorname";s:4:"type";s:4:"text";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:5:"Irene";}i:3;a:7:{s:2:"id";s:1:"7";s:4:"slug";s:8:"nachname";s:4:"name";s:8:"Nachname";s:4:"type";s:4:"text";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:8:"Oppliger";}i:4;a:7:{s:2:"id";s:3:"104";s:4:"slug";s:5:"firma";s:4:"name";s:5:"Firma";s:4:"type";s:4:"text";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:5:"OLAER";}i:5;a:7:{s:2:"id";s:3:"105";s:4:"slug";s:9:"abteilung";s:4:"name";s:9:"Abteilung";s:4:"type";s:4:"text";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:9:"Marketing";}i:6;a:7:
  8. Thank you Guru, the Admin took care of that and I changed the url. I was reading a lot about unserialize() but I am having trouble to get it to work. For an exemple the following code does not execute all the data. When I just echo the $serialized_array it gives me all the content, but the var_dump does not give me all the content. Any Ideas? $serialized_array = $result['data']; $deserialized_array = unserialize($serialized_array); var_dump($deserialized_array);
  9. Oh wow, thanks, I just ran an online tool called https://www.functions-online.com/unserialize.html and it give me an output of array ( 0 => array ( 'id' => '1', 'slug' => '1', 'name' => '', 'type' => 'fieldset', 'options' => '', 'parent_id' => '0', 'value' => '', ), 1 => array ( 'id' => '5', 'slug' => 'anrede', 'name' => 'Anrede', 'type' => 'select', 'options' => 'a:2:{i:0;s:4:"Herr";i:1;s:4:"Frau";}', 'parent_id' => '0', 'value' => 'Frau', ), 2 => array ( 'id' => '6', 'slug' => 'vorname', 'name' => 'Vorname', 'type' => 'text', 'options' => '', 'parent_id' => '0', 'value' => 'Irene', ), 3 => array ( 'id' => '7', 'slug' => 'nachname', 'name' => 'Nachname', 'type' => 'text', 'options' => '', 'parent_id' => '0', 'value' => 'Oppliger', ), 4 => array ( 'id' => '104', 'slug' => 'firma', 'name' => 'Firma', 'type' => 'text', 'options' => '', 'parent_id' => '0', 'value' => 'OLAER', ), 5 => array ( 'id' => '105', 'slug' => 'abteilung', 'name' => 'Abteilung', 'type' => 'text', 'options' => '', 'parent_id' => '0', 'value' => 'Marketing', ), 6 => array ( 'id' => '10', 'slug' => 'email', 'name' => 'Email', 'type' => 'email', 'options' => '', 'parent_id' => '0', 'value' => 'i.oppliger@bluewin.ch', ), 7 => array ( 'id' => '9', 'slug' => 'sprache', 'name' => 'Sprache', 'type' => 'select', 'options' => 'a:3:{i:0;s:7:"Deutsch";i:1;s:8:"Englisch";i:2;s:12:"Französisch";}', 'parent_id' => '0', 'value' => 'Deutsch', ), 8 => array ( 'id' => '2', 'slug' => '2', 'name' => '', 'type' => 'verification', 'options' => '', 'parent_id' => '0', 'value' => '', ), 9 => array ( 'id' => '3', 'slug' => '3', 'name' => '', 'type' => 'secret', 'options' => '', 'parent_id' => '2', 'value' => '', ), 10 => array ( 'id' => '4', 'slug' => 'anmelden', 'name' => 'Anmelden', 'type' => 'submit', 'options' => '', 'parent_id' => '2', 'value' => '', ), ) So now I just need to figure out how to get only the data I need and save it in tables so I can write an xls. Wow thank you. Maby I will have a view questions on the way. Thanks, Rilana
  10. Hi I am trying to write a dump to save data from a table in an excel. But I am having trouble with this wierd data entry, here is an example what it looks like: :4:"name";s:31:"Zusätzlicher Betreff Hydraulik";s:4:"type";s:4:"text";s:7:"options";s:0:"";s:9:"parent_id";s:1:"0";s:5:"value";s:0:"";}i:4;a:7:{s:2:"id";s:2:"17";s:4:"slug";s:22:"betreff-wasserabwasser";s:4:"name";s:23:"Betreff Wasser/Abwasser";s:4:"type";s:8:"checkbox";s:7:"options";s:250:"a:8: thats only a small part of it, but I think you get the idea. Alle the information I need is there, but it's hard to find because of the way it's coded.My approach was trying to find out if it would work with json decode, but I am not evan sure if that is what it is called. This is my approach: //query get data $sql = mysql_query("SELECT * FROM wp_visual_form_builder_entries ORDER BY form_id ASC"); $no = 1; $emparray = array(); while($result = mysql_fetch_assoc($sql)){ $row = $result['data']; $emparray[] = $row; echo $emparray; json_decode( $emparray, true ); //json_encode($emparray, true); foreach ($emparray as $v) { echo "Current value of \$emparray ist gleich $v.\n"; } But it still gives out the same format. [link removed] Can you please lead me to the right direction? I have no Idea what to do. I would appreciate it! Thank you! Rilana
  11. Thank you so much! I finnaly got it working with your second last post. It took me a while to respond because I am on vacation now and dont allways have a proper connection :-) Thank you a lot! Rilana
  12. OK, wow this actualy works and now I get what you where trying to tell me! But how to I explode [0][1][2]... without over writing $beruf ?
  13. Hi, thank you. I read all your post and tryed it out. but here is the problem : Array ( [0] => 4,9,10,11 ) this is when I print out the Array, it is that way because I am putting multiple values in one checkbox. And I will do this for more than one checkbox with the same name. So this checkbox should create this: Array ( [0] => 4 [1] => 9 [2] => 10 [3] => 11 )
  14. I am still trying to find a solution for this one. But no matter what I do it does not work. I tryed the explode function. like this: <input type="checkbox" name="beruf[]" value="4,9,10,11"/> $berufZahlen = $_POST['beruf']; $beruf = explode(",",$berufZahlen); print_r (explode(",",$berufZahlen)); But the explode function seems to be empty, the print_r returns Array ( [0] => Array ) But $beruf still somehow is filled, the mysql echo is like this INSERT INTO newsletter_beruf (userID, berufID) VALUES (179, 4,9,10,11) so in the end, still the same problem.... Please anymone, what am I doing wrong?
  15. OK, I think I understand, but I do have more checkboxes with multiple values each time and they should all be in the same array. So the only thing I can think off now is to make them all a different name in the form and then create the array in the PHP, does that sound right to you?
  16. could it be possible that I need to change this? $beruf = strip_tags($_POST['beruf']);
  17. No does not work. Output now is INSERT INTO newsletter_beruf (userID, berufID) VALUES (163, 4,9,10,11)
  18. Hey Guyes it would be soooo awsom to get your help, i am soo stuck and soo despred, I need to finish this project and i just dont get how to do it. I have a form to sign up for a newsletter which works fine. But now for the mobile version I changed it arround and I wanna give the user less choices. That means if the check a checkbox I should be able to assign multiple values in one checkbox. Like so: <input type="checkbox" name="beruf[]" value="4','9','10','11"/> But the problem is that when I pass it thrue my php it doesnt understand that these are 4 different values. My PHP looks like that $beruf = strip_tags($_POST['beruf']); foreach($_POST['beruf'] as $b) $sql = "INSERT INTO newsletter_beruf (userID, berufID) VALUES "; $c = count($_POST['beruf']); echo "anuzahl berufe $c<br>"; if($c > 1){ $i=1; foreach($_POST['beruf'] as $b){ $comma = ($i < $c) ? ',' : '';//add a coma to the end, but not the last one $sql .= "($userID,$b)$comma"; $i++; } $sql .= ''; }else if ($c == 1){ $sql .= "($userID, $b)"; } echo $sql; $mysql = mysql_query($sql); } the output is INSERT INTO newsletter_beruf (userID, berufID) VALUES (162, 4','9','10','11) unstead of INSERT INTO newsletter_beruf (userID, berufID) VALUES (162,4),(162,9),(162,10),(162,11) how can i do this right? Something like get the checkbox multiple values and assign each value to one.... please help, I would really apprechiate it! Thabk you
  19. Hi guyes... getting pretty frustrated. I am trying to make a little webApp with jqTouch. Hopefully someone can help me. I got a div that has a form in it. it looks like that: <div id="admin" class="current"> <div class="toolbar"> <h1>smarte jobs für smarte leute</h1> <a class="button slideup" id="infoButton" href="#home">Home</a> </div> <div id="test">Test</div> <form action="test.php" method="POST" class="form"> <ul> <li> <select name="kaufm" id="kaufm"> <option value="adminAll">Alle kaufmännische Stellen</option> <option value="admin">Administration/HR/Consulting/CEO</option> <option value="5" >CEO/Geschäftsführung</option> <option value="2" >Assistenz/Sekretariat/Empfang/Sachbearbeitung</option> <option value="8" >Personalwesen/‐entwicklung</option> </select> </li> <li> <select name="region" id="region"> <option value="100">Ganze Schweiz</option> <option value="2" />Rechtes Seeufer</option> <option value="6" />Graubünden</option> <option value="5" />Zürich</option> <option value="1" />Linkes Seeufer</option> <option value="3" />Glarus</option> <option value="4" />Zürich Oberland</option> <option value="7" />Zentralschweiz</option> <option value="8" />Kanton Zug</option> <option value="9" />Ostschweiz</option> <option value="10" />Deutschschweiz</option> <option value="11" />Welschland / Französische Schweiz</option> <option value="12" />Südschweiz / Italienische Schweiz</option> </select> </li> <li><select name="anstellung" id="anstellung"> <option value="100">Alle Anstellungen</option> <option value="temp" />Temporäre Anstellung</option> <option value="try" />Try and Hire</option> <option value="fest" />Feste Anstellung</option> <option value="festTemp" />Fest und Temporäre Anstellung</option> </select></li> </ul> <a style="margin:0 10px;color:rgba(0,0,0,.9)" href="#" class="submit whiteButton">Suche starten</a> </form> </li> </ul> <div class="info"> <p>Add this page to your home screen to view the custom icon, startup screen, and full screen mode.</p> </div> </div> And it is hooked up to a php that looks like that without the query... <div id="liste"> <div class="toolbar"> <? echo "<h1>$adminList</h1>"; echo "<a href='#' class='button back'>Back</a>"; echo " </div><ul class='edgetoedge'>"; $result = mysql_query($sql); $r = mysql_fetch_row($result); $numrows = $r[0]; $numrows = mysql_num_rows ($result); // makes shoure that the output is not -1 $resultOutput = mysql_query($sql); //print table echo "<span class='suche'>Ihre Suche ergab <span class='zahl'>$numrows</span> Treffer</span>"; echo "<ul class='paging'>"; while($row = mysql_fetch_array($resultOutput)) { $id=($row['stelleID']); $datumsanzeige=($row['stelleDatumsanzeige']); $datum=(date("d.m.y", strtotime($row["stelleDatum"]))); $today = date("d.m.y"); if($datumsanzeige == "fake") { $datumDef = "$today"; } else { $datumDef = "$datum"; } // Print out the contents of each row into a table echo "<li><span class='stellen'>"; echo $row['stellePosition']; echo "</span>"; echo "<br>"; $stelleIDDetail = $row['stelleID']; $text=strip_tags (html_entity_decode($row['stelleStellenbeschrieb'])); // 0,100 show 100 Zeichen echo substr($text,0,150); echo "... "; echo "<a href='#$stelleIDDetail'>|weiter > </a>"; echo "</li>"; echo "<div id='$stelleIDDetail'>Detail</div>"; } echo "</ul>"; echo mysql_error(); mysql_close($con); ?> </ul> </div> it seems to work, it lists the request, but it also shows the <div id='$stelleIDDetail'>Detail</div> Tag. And I want it to be hidden till the details are requested by klicking on |weiter > in jqtouch all the div id's are supposed to be hidden till they are called with an <a href='#. Can anyone help me please? Maby I am evan on the wrong path and there is a much easier way to do this. Thanks for any help, Rilana
  20. Hi everyone, I am trying to change my existing php mysql script to something more exiting and up to date. http://neu.smartpersonal.ch/stellen.php so far the I was able with researches to complete a ajax request with a Button, but I would like to do the refresh on change so I would not need a button. But somehow I cant get it to work. I would aprechiate any help. Here is what I have: HTML <form> <select name="kategorie" id="kategorie"> <option value="">Kagegorie wählen:</option> <option value="1" />Technische Berufe</option> <option value="3" />Bau</option> <option value="4" />Verkauf</option> <option value="2" />Kaufmännische Berufe</option> </select> <select name="region" id="region"> <option value="1,2,4,5,">Region wählen:</option> <option value="1" />Linkes Seeufer</option> <option value="2" />Rechtes Seeufer</option> <option value="4" />Zürich Oberland</option> <option value="5" />Zürich</option> </select> <input type='button' value='Refresh Data' onclick="showUser(document.getElementById('kategorie').value,document.getElementById('region').value)"> </form> the javascript: var xmlhttp; function showUser(str,region) { xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="stellenResult.php"; url=url+"?q="+str+"&a="+region; url=url+"&sid="+Math.random(); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function stateChanged() { if (xmlhttp.readyState==4) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } Thank you for helping. Rilana
  21. Hi Guyes I didn't do php for a while and now I have to update a project I did a while back. So I dicided to throw some AJAX in there... So I grabed some tutorial and now I am kind of back to scratch. I would really aprechiate your help. I have a database, a html and a php file. Rightnow things looke like this: http://neu.smartpersonal.ch/stellen.php At first looke it seems to work, but then I realized that it puts jobs with the same ID out more then once. Much more then once... My HTML looks like that: <script type="text/javascript"> function showUser(str) { if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","stellenResult.php?q="+str,true); xmlhttp.send(); } </script> </head> <body id="stellen"> <div id="container"> <div id="banner" ><h1> </h1> </div> <div id="left"> <a href="index.php"><img src="pic/logoLeftWeb.gif" border="0" /> </a></div> <div id="right"> </div> <!-- end menu right --> <div id="content"> <div id="nav"><? include("nav.html"); ?> </div> <h3><strong>Finden</strong> Sie Ihre <strong>Gelegenheit</strong></h3> <form> <select name="users" onchange="showUser(this.value)"> <option value="">Kagegorie wählen:</option> <option value="1" />Technische Berufe</option> <option value="3" />Bau</option> <option value="4" />Verkauf</option> <option value="2" />Kaufmännische Berufe</option> </select> </form> <div id="txtHint"><b>Person info will be listed here.</b></div> And my PHP looks like that: <? //java $q=$_GET["q"]; // Make a MySQL Connection $con = mysql_connect("", "", "") or die(mysql_error()); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("", $con); mysql_query("SET NAMES 'UTF8'"); $sql = "SELECT * FROM stelle JOIN stelle_region ON stelle_region.stelleID=stelle.stelleID JOIN region ON region.regionID=stelle_region.regionID JOIN stelle_beruf ON stelle_beruf.stelleID=stelle.stelleID JOIN beruf ON beruf.berufID=stelle_beruf.berufID WHERE stelle_beruf.berufID = '".$q."'"; echo $sql; $result = mysql_query($sql); $r = mysql_fetch_row($result); $numrows = $r[0]; $numrows = mysql_num_rows ($result); //print table echo "<table width='100%' border='0' cellpadding='0'>"; echo "<tr height='40px'><td>"; echo "Ihre Suche ergab $numrows Treffer"; echo "</tr></td><td></td></tr>"; while($row = mysql_fetch_array( $result )) { $id=($row['stelleID']); $datumsanzeige=($row['stelleDatumsanzeige']); $datum=(date("d.m.y", strtotime($row["stelleDatum"]))); $today = date("d.m.y"); if($datumsanzeige == "fake") { $datumDef = "$today"; } else { $datumDef = "$datum"; } // Print out the contents of each row into a table echo "<tr><td class='stellen'>"; echo $row['stellePosition']; echo "<br>"; echo $row['berufName']; echo "<br>"; echo $row['stelleID']; echo "</td><td>"; echo "$datumDef"; echo "</td></tr><tr><td>"; //take <li> away $text=strip_tags ($row['stelleStellenbeschrieb']); // 0,100 show 100 Zeichen echo substr($text,0,100); echo "... "; echo "<a href=\"stellenDetail.php?stelleID=$row[stelleID]\">|weiter > </a>"; echo "</td></tr>"; echo "<tr><td>"; echo "</td></tr>"; echo "<tr><td colspan='2' class='line'><br></td><td></td></tr>"; } echo "<tr><td>"; echo "</td></tr>"; echo "</table>"; echo mysql_error(); mysql_close($con); ?> I dont understand why it would put the same id's out more then once...??? And I dont see a pattern in it eighter. I would really aprechiate some help or hints thank you so much! Rilana
  22. Hi guyes I am trying to figure out how to adapt a graph to a different currency. The code i used for this was born thanks to this forum a cupple of years ago http://www.phpfreaks.com/forums/index.php/topic,208349.30.html thanks again, without you I would have had no clue at all. Anyway, this is my new problem now. I am having a graph with CHF values from 340 to 740 and a graph with EUR values from 220 to 500. Evan do the graph is basicaly the same, it looks different becuase of the exchange rate, EUR is smaller then CHF so the graph looks squized in the y-axes... Now I tryed several things to make the graph grow, but I think the problem is that it will allways draw a pixel for a value (1 = 1px). So is there anyway I can say 1 is 1.5px? Thank you for your help, I am not evan shoure if I am thinking on the right end. Thank you, Rilana
  23. Thank you! I am done with the project and I learned a lot! Thank you all!!! I couldn't have done it without you! Thank you, Rilana
  24. Thank you for your replay. I tryed several things now and came up with this code: $sqlR = "SELECT * FROM stelle_region WHERE stelleID=$stelleID"; $resultR = mysql_query($sqlR,$con); while($row = mysql_fetch_array($resultR)) { $region=($row['regionID']); print_r ($region); if($region == "1") { echo "<input type='checkbox' name='region[]' value='1' echo'CHECKED'/>Linkes Zürichseeufer<br />"; } if($region == "2") { echo "<input type='checkbox' name='region[]' value='2' echo'CHECKED'/>Rechtes Zürichseeufer<br />"; } if($region == "3") { echo "<input type='checkbox' name='region[]' value='3' echo'CHECKED'/>Glarus<br />"; } } this works fine but there is one big Problem I am having. I also need to show the checkboxes which dont have a entry in the database so it's possible to check them in edit mode. I tryed to do it like this: if($region == "1") { echo "<input type='checkbox' name='region[]' value='1' echo'CHECKED'/>Linkes Zürichseeufer<br />"; } else { echo "<input type='checkbox' name='region[]' value='1' >Linkes Zürichseeufer<br />"; { the problem with that is the while function I think, because if I have 2 entrys or more in multiplys my checkboxes.... What can I do to show all the checkboxes that are possible without multiplying them and checking the right once? Thank you so much for your Help! I am going grazy over this!
×
×
  • 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.