[PHP-DB] Selecting Drop Down Value From DB to Edit

2002-03-27 Thread Steve Fitzgerald
I have the below code that populates a drop down list. The code will correctly insert the value $StateID into another a table. The problem I am running into is that when I select the record to edit the drop-downlist has the first option as the value instead of what the corresponding StateID in the

Re: [PHP-DB] Selecting Drop Down Value From DB to Edit

2002-03-27 Thread Steve Fitzgerald
or="#cc"> <td valign="middle" height="25" class="raceresutlstitle" bgcolor="#cc">Race Report:</td> <td valign="middle" bgcolor="#cc"> <textarea name="RaceReport" cols

[PHP-DB] mysql query problem

2001-07-26 Thread Steve Fitzgerald
I'm trying to query my database to fill in data First Name Last Name. Using the script below I get (depending on the ContactID I enter) Contact: 1 1 or 2 2 If ContactID=0 I get Contact: Any ideas on what I am doing wrong? Thanks. Steve Fitzgerald \n", mysql_result($result

Re: [PHP-DB] mysql query problem

2001-07-26 Thread Steve Fitzgerald
(depending on the ContactID I enter) > > > > Contact: 1 1 or 2 2 > > > > If ContactID=0 I get > > > > Contact: > > > > Any ideas on what I am doing wrong? > > > > Thanks. > > > > Steve Fitzgerald > > > > >

[PHP-DB] Search Query

2001-07-27 Thread Steve Fitzgerald
ve=no which would indicate the contact is no longer active). I would then like to have the result(s) to have a link to their respective ContactID. I don't think this is that difficult, but I'm having difficulty applying the SELECT statement with the text box. Any help would be greatly appr

[PHP-DB] Record Update Link

2001-07-27 Thread Steve Fitzgerald
I seem to be having difficulty creating a hypertext link between the results of a sql query, ie a a formated page with a contact record (FirstName, LastName, etc.) to a page that will allow for editing. The results page is text only and the edit/update page has text boxes. Not sure if this clear,

[PHP-DB] 2 Tables- 1 Insert Problem

2001-07-28 Thread Steve Fitzgerald
I'm trying to insert data into two separate tables using 1 INSERT. The code below represents a first crack at it, but I can't seem to figure out how to get this to work properly. Thanks. Steve -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For

[PHP-DB] multiple table query error

2001-07-29 Thread Steve Fitzgerald
I've figured out (with some help) how to query two tables at the same time. In order to get a corresponding CompanyName with a specified ContactID I created a SQL query that selects both tables ($table_name1,$table_name2) and then selects contacts.CompanyID = '$CompanyID'. The result is a match fo

[PHP-DB] A Join Question

2001-07-30 Thread Steve Fitzgerald
I'm trying to create a join statement that pulls out a CompanyName based on a given CompanyID that is tied to a specified ContactID. For example, if ContactID=1 then the corresponding CompanyName might be Smith, Inc. depending on what was entered. Here are the tables. table = Contacts -

[PHP-DB] INSERT with a JOIN

2001-07-30 Thread Steve Fitzgerald
I'm trying to create an INSERT statement that will change a field in one table based upon the id defined in another table. Here is what I tried: $sql1 = "INSERT INTO $table_name1 (FirstName,LastName,WorkPhone, HomePhone,EmailName,Birthday) VALUES ('[$FirstName]','[$LastName]','[$WorkPhone]','[$H

[PHP-DB] INSERT Won't Insert

2001-08-01 Thread Steve Fitzgerald
This should be a simple insert. I must be missing something because I keep getting: Couldn't execute query. What am I missing? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list

[PHP-DB] Avoiding Multiple IDs

2001-08-01 Thread Steve Fitzgerald
What is the best method for avoiding multiple ids for the same information. For example: I have a table name company that has unique ids. The CompanyID are tied to a table name contacts which have unique ids (ContactID). The problem seems to be that if I add a contact with an existing CompanyName

[PHP-DB] UPDATE Not Updating

2001-08-01 Thread Steve Fitzgerald
I belive this UPDATE should work, but it isn't. I get no errors. I have also tried using FieldName= '$Fieldname', but that does not seem to work either. $table_name = "contacts"; $update_contact_sql = "UPDATE $table_name SET FirstName =\"$FirstName\", LastName = \"$LastName\", Title = \"$Titl

[PHP-DB] Re: SQL Error

2001-08-02 Thread Steve Fitzgerald
"Steve Fitzgerald" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I keep getting the following SQL error: > The last fieldname is CompanyID not ContactID. You have an error in your SQL syntax near ')' at line 14 &g

[PHP-DB] SQL Error

2001-08-02 Thread Steve Fitzgerald
I keep getting the following SQL error: You have an error in your SQL syntax near ')' at line 14 Line 14 is: '$FirstName', so the error must correspond to a different part of the code. Any ideas? $add_contact_sql = "INSERT INTO $table_name (ContactID, FirstName, LastName, Title, WorkPhone, Hom

[PHP-DB] Re: UPDATE Not Updating

2001-08-03 Thread Steve Fitzgerald
and gave the ContactID a value which worked fine. I'm not sure why the query string is not passing the value. "Steve Fitzgerald" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I belive this UPDATE should work, but it isn't. I ge

[PHP-DB] Permissions

2001-08-03 Thread Steve Fitzgerald
I'm trying to build a menu page that builds links based upon specified permissions that are associated with a username or userid. I figure it might be best to associate individual privleges to specific menu items within the usertable (using checkboxes, etc). then building the menu based upon the

[PHP-DB] List Results Not Working

2001-08-04 Thread Steve Fitzgerald
I'm trying to list the results of a query, but I keep getting the following error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' I must be missing something because I can't find what's causing the pars

[PHP-DB] Select & Inner Join Question

2001-08-06 Thread Steve Fitzgerald
I'm trying to display a summary list of calls with one attribute being CallType. I have CallType and CallTypeID defined in a table name calltypes. The problem I am having is taking the output of CallID defined in calls and having the script match the CallTypeID to the CallType. If I run the displa