Jump to content

bnther

Member
  • Posts

    12
  • Joined

  • Last visited

bnther's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks for the reply. THE CHILLS ?! LOL The work is for a local chamber of commerce and it is for free (yuck). I really don't like doing free work, not because I'm greedy...OK maybe not JUST because I'm greedy, but I've found that people really don't appreciate it when they don't have a concept of the effort I'm putting in. In the very least, they seem less likely to give you 'little things' to work on if they know that I'll send them a bill for it. That being said, I felt that this would be a good opportunity to build a little experience with something that it is new to me. I'm pretty much resolved that I will always be learning something in this profession. As far as security, the form will not be linked to the website. The chamber secretary will need the actual address to access the form. There will be a user name and password to the form, as well as the database. It might not be bullet proof, but it's a place to start. Thanks again for the reply.
  2. Thanks for the reply. Also, thanks for the tutorials. I've used them quite a bit and they've been a big help. I'll work a little with the code that you presented in this post. At glance, it seems to make pretty easy sense. Same thing, just different angle Thanks again for the help.
  3. I'm a good way through building my 'membership form'. (At least I think I am) I have written a form that will allow me to add to a database and even included a little validation. I can sort and output the database and everything is moving along. What I don't know how to do is bring the info back into a form that I can edit. For example, if a member changes their phone#, as it stands right now, I'd have to change it directly in phpMyAdmin. The LAST thing I want is for my client figure out where that is! So how do I fill a form with values from a database where I can later hit 'update'? Links to tutorials would be greatly appreciated.
  4. bnther

    An array question

    I have a couple of questions on that code (which works perfectly by the way ) $data - I didn't declare this anywhere and yet nothing error'd out. Why? 'b_title' is the name of the field and you used it directly. I'm used to naming variables for everything (a practice I've always that was extremely redundant). I think it would be great if I use it directly as opposed to creating 'handles' for everything. Just call it what it is, you know?! At any rate, this was very educational. Thank you
  5. bnther

    An array question

    Thanks for the reply. You're right, I am storing ALL of the field data under 1 variable - hence the problem. With regards to what I'm using the data for, it will only be for show. I will at some point (hopefully) be able to select 'type' (attorneys, manufacturing, Realtor, ect) from a drop down and sort through the database that way. I have a specific field for that. Thanks for the links. Ironically, I had been to all 3, but I could cipher things out until you replied. This has been a big help. Thanks again for the reply
  6. bnther

    An array question

    I think what's happening here, is every entry in the database under a certain field name 'c_name' (contact name) for example, is being displayed simultaneously. What I need is to have the field data for its corresponding row to be displayed and nothing else. Any thoughts?
  7. bnther

    An array question

    I have a database with 1 table and 2 records. I want to fill the array with those two records -- and it is -- but when I loop through the array, instead of outputting 1 complete record at a time it's outputting everything twice. For example, if I had 2 business names of Apple Computers and Windows, then I would output Apple ComputersWindows (because they both have the same variable) on the same line and it would do it twice because there are 2 records. What I need is for Apple Computer and all of its info to be displayed by itself and then loop through to output Windows and the relative info. Here's my array code: // set up for accessing the database 'select' $query = "SELECT * FROM members"; $result = mysql_query($query); $my_business_title = ""; $my_contact_name = ""; $my_street_address = ""; $my_city_address = ""; $my_phone = ""; $my_fax = ""; $my_email = ""; $my_website = ""; $my_comments = ""; // record type -- accounting -> retail $my_type = ""; //loop stuff $num = mysql_numrows($result); $i=0; //fill the array from the database 'members' while($row = mysql_fetch_array($result, MYSQL_ASSOC))// I think this is where I'm screwing up { $my_business_title = $my_business_title . "{$row['b_title']}"; $my_contact_name = $my_contact_name . "{$row['c_name']}"; $my_street_address = $my_street_address . "{$row['st_address']}"; $my_city_address = $my_city_address . "{$row['city_address']}"; $my_phone = $my_phone . "{$row['phone']}"; $my_fax = $my_fax . "{$row['fax']}"; $my_email = $my_email . "{$row['email']}"; $my_website = $my_website . "{$row['website']}"; $my_comments = $my_comments . "{$row['comments']}"; // record type $my_type = $my_type . "{$row['type']}"; }
  8. Yep that did it. I'll have to look into these 'short tags'. I've never seen that before Many thanks for the help (It's Friday night...why aren't we out partying it up? )
  9. I have email and website info stored in a mysql database; type varchar() I can display the info, but I haven't figured out how to fill in the address field when Outlook pops up. Any thoughts? Here's the code: <?php echo $my_email; ?>
  10. Yep, that was it. Ooops You think that I would have caught that one. There is where an extra set of eyes helped. Many thanks for that.
  11. falkencreative, Thanks for the reply. I think that it connecting OK. If I comment out the MYSQL stuff, the page runs just fine. I commented out one line at a time and it's the $result = mysql_query($query); that's throwing the error. Here's the code: <?php // connect to a database $my_connection = mysql_connect('localhost', 'root', ''); if(!$my_connection){ die("Could not connect: " . mysql_error()); } echo "Connected Successfully to mySQL server" . " "; $my_database = mysql_select_db('killer'); if(!$my_database){ die("Could not find database: " . mysql_error()); } mysql_close($my_connection); // set up for accessing the database 'select' //$query = "SELECT * FROM people"; //$result = mysql_query($query); //$my_rows; // //while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ // $my_rows = $my_rows . "Name : {$row['name']} " . "id : {$row['id']} "; //} ?>
  12. I'm going through the PHP-MYSQL tutorials and I've hit this block. I've checked the 'killer' database and it clearly says 'YES' with ALL PRIVILEGES. Where is this ODBC user coming from and most importantly, how to I grant it access? Thanks bnther
×
×
  • Create New...