php - MySQL create table failing to create table -
i trying create table using mysql , php not understand why fails maybe can help me.
<?php $dbh = new pdo('mysql:host=localhost;dbname=test', 'root', ''); $createcontextuallinksettingstable = $dbh->prepare(" create table if not exists contextuallinksettings ( window_onload text, use_monetizer text, apple_link_check text, amazon_link_check text, clickbank_link_check text, commission_junction_link_check text, ebay_link_check text, linkshare_link_check text, ad_timer text, use_apple text, use_amazon text, use_clickbank text, use_commission_junction text, use_ebay text, use_linkshare text, apple_affiliate_token text, apple_campaign_value text, apple_country text, amazon_associate_id text, amazon_aws_access_key_id text, amazon_aws_secret_key text, amazon_country text, clickbank_affiliate_id text, clickbank_customisation text, clickbank_affiliate_tracking_id text, microsoft_client_id text, microsoft_client_secret text, commission_junction_site_id text, commission_junction_api_key text, commission_junction_country text, commission_junction_currency_type text, commission_junction_low_price text, commission_junction_high_price text, ebay_app_id text, ebay_country text, ebay_sort_order text, ebay_category_id text, linkshare_token text, linkshare_advertiser_mid text, main_path text, use_monetizer text, popup_font_color text, popup_link_color text, popup_link_hover_color text, popup_link_font_color text, popup_link_link_color text, popup_link_link_hover_color text, apple_explicit text, apple_link_check text, apple_auto_generated text, amazon_auto_generated text, amazon_link_check text, commission_junction_advertiser_relationship text, commision_junction_cache_duration text, commission_junction_auto_generated text, commission_junction_link_check text, linkshare_auto_generated text, linkshare_link_check text, clickbank_auto_generated text, clickbank_language text, clickbank_font_color text, clickbank_link_color text, clickbank_link_hover_color text, clickbank_link_check text, ebay_auto_generated text, ebay_link_check text ); "); $createcontextuallinksettingstable->execute(); ?>
if remove entries after main path create table, why this. if remove after main_path text creates table why?
sql error 1060. duplicate column name.
you have duplicated use_monetizer
column there.
for long statements - consider using tool helps in sql.
if have database on localhost - mysql workbench best idea.
if using hosting server - has phpmyadmin installed.
and should larn using php mysql. don't know how read error message.
you can start learning here: php academy on youtube
php mysql
No comments:
Post a Comment