Jump to content

blanktarget

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

blanktarget's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks. That worked well, I had to change \"\'$id\'\" to \' . $id \'
  2. I have a listing that needs to added from a content management system. The add script is getting the row\'s id from the page before it $id=$_GET[\'id\']; what I want to do is have that number which exists in a table for temporary listings and move it (with the \'add\' script) into the permament \'listing\' table from the content management system. $query="INSERT INTO listing (business, name, address, phone, website, email,) VALUES (\'business\',\'name\', \'address\', \'phone\', \'website\', \'email\',) FROM temp_listing WHERE temp_listing_id=\'$id\'" $result=mysql_query($query);
  3. I\'m using this: DELETE FROM table WHERE table_id=100; to delete the row where the id is 100. Only it\'s deleting the whole table.
  4. I have a temp table that I use t insert listings before I insert them into the main db, so i can view them and validate them. Can I simply copy rows into other tables?
  5. I can\'t get this text fle imported. I have over one hundreditems I want into one field, the table has two fields, an auto_increm id field and the other field which is varchar data. I get all manner of errors inserting them. $sql= \"INSERT INTO table (\'column_2\') VALUES (\'item_1,\')\"; \"INSERT INTO table (\'column_2\') VALUES (\'item_2,)\"; etc 100 times. if (@mysql_query($sql)) { echo(\"<h4 align=\'center\'>Your listing has been added</h4><br>\"); } else { echo(\"<h4>Error the adding the listing: \" . mysql_error() . \"</h4>\"); } what is wrong?
  6. will that put each group into the same field in the db?
  7. I have form data where one field is a multiple select. I\'ve set up a table for the multiple select data-\'group\', I have a table for the rest of the data-\'listing\'. I have a third table-\'link\' which has the primary keys from each of the other tables, group_id and listing_id, because I need each client\'s listing, which is phone, name, etc. to correspond with all of the groups that they select in the form. I have this layyed out as a script but it seems messy and I don\'t know if it will work as the database grows after connection and form validation: insert into table listing (column_1, etc) values ($name, etc) select * from listing order by \'listin_id\' limit 0, 1 //to get the last row? and then insert the groups selected with the listing_id for reference into the \'link\' table. Somehow this seems like it\'s almost there. That multi select is killing me, this should be easy.
  8. For some reason phpmyadmin is set up by default, to not have linking of foreign keys enabled. I have done ALL of this: $cfg[\'Servers\'][$i][\'relation\'] string Since release 2.2.4 you can describe, in a special \'relation\' table, which field is a key in another table (a foreign key). phpMyAdmin currently uses this to * make clickable, when you browse the master table, the data values that point to the foreign table; * display in an optional tool-tip the \"display field\" when browsing the master table, if you move the mouse to a column containing a foreign key (use also the \'table_info\' table); (see FAQ 6.7) * in edit/insert mode, display a drop-down list of possible foreign keys (key value and \"display field\" are shown) (see FAQ 6.21) * display links on the table properties page, to check referential integrity (display missing foreign keys) for each described key; * in query-by-example, create automatic joins (see FAQ 6.6) * enable you to get a PDF schema of your database (also uses the table_coords table). The keys can be numeric or character. To allow the usage of this functionality the superuser has to: * set up \"pmadb\" as described above * within this database create a table following this scheme: CREATE TABLE `pma_relation` ( `master_db` varchar(64) NOT NULL default \'\', `master_table` varchar(64) NOT NULL default \'\', `master_field` varchar(64) NOT NULL default \'\', `foreign_db` varchar(64) NOT NULL default \'\', `foreign_table` varchar(64) NOT NULL default \'\', `foreign_field` varchar(64) NOT NULL default \'\', PRIMARY KEY (`master_db`, `master_table`, `master_field`), KEY foreign_field (foreign_db, foreign_table) ) TYPE=MyISAM COMMENT=\'Relation table\'; * put the relation table name in $cfg[\'Servers\'][$i][\'relation\'] * now as normal user open phpMyAdmin and for each one of your tables where you want to use this feature, click \"Structure/Relation view/\" and choose foreign fields. But the drop down menus in the relation view are empty and don\'t drop down. There is no place for me to set foreign keys. Anyone have this problem before? :evil:
  9. Oh okay, then they are linked. Thanks!
  10. I forgot to say that I also have a \'client_id\' field within each client row
  11. I have 2 tables that relate.One table has a listing of \'groups\' and an auto_incrementing ID number The other has client name and address, etc. I want to be able to have a single client listing point to several \'groups\'. But the data will not be normailized if i have multiple \'group\' fields in each client row. What I\'m thinking is this \'name\', \'address\', \'website\', \'phone\', \'email\', \'group_id1\', \'goupr_id2\', ... Will this cause problems or am I doing that wrong?
×
×
  • 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.