Jump to content

DLR

Members
  • Posts

    66
  • Joined

  • Last visited

Everything posted by DLR

  1. Hi. Firstly I am a member of long standing so I am now at the opposite end of the age scale to most of you - I only started programming in my middle fifties! - so I may be way out on this suggestion. I have been searching to find a good tutorial to change from MySql to MySqli. Most of what I find on the net seems to focus on the actual connection. Making the change to the connection is easy - but from there on everything seems to go haywire. My site make use of the "get_include_contents(X)" style instead of require(X) that was covered in the php Manual. Now this does not seem to work (for me anyway). I favour the procedural style, mostly as I believe I can avoid learning the OOP method (too old to get my head around it now) and that may be the problem. However, there may perhaps be many others who are starting to face the necessity of changing to MySqli fairly soon - and your expertise will be welcomed I'm sure. I certainly have benefited from your collective input over the years - for which I give you all my heartfelt thanks. Thank you for reading this suggestion.
  2. Thank you. It is as if a light has gone on! I am researching Select, but it would seem that your suggestion of left join will be more elegant. Thanks again!
  3. Hi, There must be a simple way of doing this, but I seem to have missed it and I cannot get my own method to work I have a list of emails and names (subscribers) and another list of unsubscribed emails with names (unsubscribed). (This is a legacy from a previous emailing programme - Mailloop6). I want to create one table (final_list) where the unsubscribed names have been removed. My methodology is to create an array from "subscribers", create an array from "unsubscribed" , then loop through "subscribers" and save the names that are not found in "unsubscribed", into a new table "final_list". I have checked, the "sucribers" and "unsubscribed" arrays hold 4700 and 666 records each - so the creating array part works. My problem is in inserting into "final_list". Each table and array has 3 fields :email, first_name, last_name foreach ($subscribed as $key => $value) { if(in_array($value,$unsubscribed)) { //do nothing as we do not want this information to be stored } else { $sql = "INSERT INTO final_list (email,first_name,last_name) VALUES ('" . $value[$key]['email'] . " ', '" . $value[$key]['first_name'] . " ', '" . $value[$key]['last_name'] . " ') "; $res = mysql_query($sql); if(! $res) { echo '<br>..no record inserted into final list ' . $key. '<br>'; } } } Thanks for reading this - any help will be appreciated
  4. Is this possible with mysql 5.1? I want to join a table MENU from database A to table PERMISSIONS from database B (and then if I can get this to work, extend this to further databases C, D etc). I have tried creating a temporary table in database A and trying to LEFT JOIN to the table in database B - but which connection do I use? So far I have not got this to work. If it is possible to join two databases, I would appreciate you pointing me to the manual section (or other reference) where I can solve the problem. Many thanks.
×
×
  • 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.