Jump to content

Germaris

Members
  • Posts

    97
  • Joined

  • Last visited

Everything posted by Germaris

  1. 1 - foreach ($mystring as $eachstring) print $eachstring; WRONG. IT PRINTS ONLY THE LAST STRING.(see one of my posts). I DON'T KNOW WHY... NO THIS IS WHAT I WANT. BUT WHERE DO I USE count($mystring)? 2 - IN THAT PART, I DON'T USE FONT TAGS (see the code I wrote). I WISH TO SEND VARIABLES VALUES ("&a=".row['lastName'] for example). Font and color of text are assigned by the Flash Fields which receive the variables. HOW CAN I DO THIS? THIS IS VERY INTERESTING AND I THINK WILL BE USEFUL FOR ME !!! Thanks for your help! :-)
  2. Okay. Thanks! I go for it: 1 - How can I automate the printing of the strings (print $mystring[1].$mystring[2]) in relation with the number of results the array contains? May be I must include in my query a COUNT statement which will return the number of rows containing the searched phone number? So, after, I can use this result to say to the machine (!!!) for example: print 4 strings ($mystring[1].$mystring[2].$mystring[3].$mystring[4]); I know, this seems a little akward but I hope you'll understand! :-) 2 - How can I "explode" a chosen string in the array so I can send it as separate elements to my Flash file? Example: I want to "explode" mystring[0] so I can send this to Flash: $new_string = explode(mystring[0]); $new_string .= "&a=".row['lastName']."&b=".row['firstName']."&c=".row['school']."&d=".row['year']; print $new_string; I know for sure what I wrote here is wrong, but it the idea that count! lol !!!
  3. GOOD! I wrote: print $mystring[1].$mystring[2]; And it worked fine. Congratulations! Now I've understood the "mechanics". I f you have some time, may I ask you something else? If not, I can wait... Anyway, thank you very much for all you've done so far!
  4. No. I may want it in the future but it isn't what I want for the moment. What you wrote is working and is exactly what I did. And it gives me only the third string (the last) of the array. What should I write if I want, for example, the second string?
  5. OK. I did what you say. It works fine. BUT: In my test, I knew in advance what the result would be. And in this test we obtain three rows from the table. Each one containing lastName, firstName, school and year. print $mystring; just give me the third row (the last one) How can I dot to get the other two (the first and the second) or only one of those two? I believed that arrays in PHP (just like in Flash ActionScript) have indexed strings ([0], [1], [2], ... )and that we could call for any of them to print...
  6. Thanks for your interest and replying so fast! Yes, I did this BUT AFTER, how can I extract the data from this array ?
  7. Hi there! I perfom a simple query for retrieving phone numbers: $query = mysql_query( "SELECT * FROM $table WHERE phone='$sphone') or die ( "select error " . mysql_error() ); if ( mysql_num_rows( $query ) > 0 ) while ( $row = mysql_fetch_array( $query ) ) { $mystring .= "<font color='#000099'>".$row ["lastName" ]." "."</font>"."<font color='#663399'>".$row ["firstName" ]."</font>".", "."<font color='#0033CC'>".$row ["school" ]." - ".$row ["year" ]."</font>"."<br />"; } print $mystring; (I send $mystring to a .swf file where it is parsed, this is the reason why I use FONT tags which are amongst the few Flash can accept. But this has no importance for solving my problem...) When only one number is found: no problem But if there's duplicates, it becomes more complicated (for me!) to handle... How can I get all the results (in an array or each designated by a new string ?) so I can choose, later in the script, which one to display (formatted as shown in the code) depending on some conditional logics? If I sort within an Array, how do I create it and HOW DO I EXTRACT DATA FROM IT? This is the most important which I don't know !!! Many thanks in advance! Regards. Gerard
  8. Thank you very much for your appreciated reply! Okay, understood, this is the first step: conversion of the user's string. Now, how can I write my MySQL query to make it reading the field ignoring the spaces it contains? Because if I don't do that, it will returns no result...
  9. Hi there! I've built a search that works but relies on the users to input their request very accurately. The data they're searching on are phone numbers which come from a MySQL DB. In the DB, phone numbers (from all over the world) are stored WITH spaces, like for example: 123 456 7890 What happens is people are typing in "1234567890" and this is coming up with no result. This also occurs if users type in: "123 4567890"... May be it would be also necessary to eliminate all spaces in the user's request prior to execute the query... How should I write my queries to make them work? Due to the infinite power of PHP, I'm quite sure a simple solution exists. The script could first transform the user's string in a string with no spaces then compares this new string against those contained in the DB ignoring while reading the existing spaces... This method avoid modification of the DB... Any help would be most appreciated and I thank you in advance for it.
  10. Hi! Listen: I really am a junior in PHP. Excuse me, but what you mentioned is like chinese for me! Could you explain, please? Thanks. PS : I believed port 21 was a ftp Port...
  11. Hi there! In a registration form, I have an input field for entering the email address. How do I use, in the verification process of the form, the getmxrr function to verify if the proposed email address really exists? Many thanks in advance for any help!
  12. Good Job !!! This one works fine. Many thanks for this valuable help. Best regards,
  13. Sorry it doesn't work... Thanks anyway for replying!
  14. Hi there! I wish to update the content of a field but WITHOUT erasing its existing content. New content needs to be added to the existing one. Each chunk separated by a line break. How should I write the query? Many thanks in advance for any help!
  15. This very last version works perfectly! Congratulations and many thanks for your valuable time and help! Best regards.
  16. Sorry ! Wrong posting ! I deeply apologize.
  17. Crystal clear, Little Guy, but it doesn't work... :-( There's a mistake before the first print instruction but I can't find it...
  18. Ouf !!! I didn't expect so much replies !!! Thank you, thank you, thank you ! BUT : I don't understand to use this treasure inside my script of which you'll find the interesting part below... <?php function hello($unlock,$username,$userpass) { if ($unlock < 1) print "Acces interdit."; else { GLOBAL $db,$table; $username = trim($username); $password = md5(trim($userpass)); $query = mysql_query("SELECT * FROM $table WHERE userName = '$username' AND userPassword = '$password'") or die("&erreur=Connexion impossible avec la base de données de l'Annuaire."); if ( mysql_num_rows( $query ) > 0) { while ($row =mysql_fetch_array ($query ) ) { $flashstr .= "Bonjour ".$row ["firstName" ]." !"; } print "&prenomutilisateur=".$flashstr; } else { print "&prenomutilisateur=Bonjour, cher camarade !"; } } } ?>
  19. Hi there ! I manage a directory of former students. Among many functions, users can perform a search which returns the full identity of a friend. In the MySQL table there's a row nammed firstName which can contain up to four names. How can I modify my script in order to retrieve only the first name in the row i.e. the first word before a space? Many thanks in advance for your help! Best regards.
  20. Hi there ! I wish to display in my Flash File (don't worry about Flash, I know how to handle PHP results and send them to Flash !) which is read all throughout the world, the Full Date and Time of my Home. My Server is in California, I am living in Quebec (three hours of difference) and my File could be read by friends in Japan or Indi or South Africa. Displaying the Date and Time of my Home will say to my friends, for example : "Don't phone me, I'm sleeping" !!! He he he... I thank you very much in advance for any advice, link, or active help !!!
  21. Hi there! my_table has 23043 records. The next autoindex indicates 23047. I have verified the largest index value allocated which is 23046 and which is correct. How can I find the two index values which aren't used? (so I can use them with new records and therefore have the index values and the number of records having the same value : 23046). Many thanks in advance for your help.
  22. WOW! VERY SMART... and CRYSTAL CLEAR. Why shouldn't think about this solution before? Many thanks. Best, Gerard
  23. Thank you for your reply! But it looks like Chinese for me...  ;D i.i. I don't understand what you wrote... I'm looking for a SQL Query which I can enter in phpMyAdmin...
  24. Hi there ! I'm quite desperate as I can't find a quick method to partially change the content of a field. I explain: In a field named 'notes', PART of the content is: [code]<a href='mailto:"abc@domain.com"'>abc@domain.com</a>[/code] This content is wrong. It must be: [code]<a href="mailto:abc@domain.com">abc@domain.com</a>[/code] How can I make the change with a SQL Query instead of manually make the change row by row (approximately 1500 rows contain the error!!!) considering the fact that abc@domain.com is different in each of the rows? Many thanks in advance for any help! Best regards, Gerard
  25. Problem solved! [code] mySearch.onLoad = function(ok) { if (ok) { mySearch.undefined == "0"; _root.aiFld.text = mySearch.ai; _root.adFld.text = mySearch.ad; _root.auFld.text = mySearch.au; _root.errorMsg.text = "OK"; } else { _root.errorMsg.text = "BAD"; } }; [/code] This AS leaves the dynamic fields blanks which is satisfactory... ;) ;) ;)
×
×
  • 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.