/    Sign up×
Community /Pin to ProfileBookmark

How To Write Php Code To Deal With Mysql Tbl ?

@NogDog,
@Sempervivum,
@DaveyErwin,

If this creates tbl:

““

$sql = “CREATE TABLE IF NOT EXISTS TestE (
page_url VARCHAR(255),
link_anchor_text VARCHAR(255),
page_description VARCHAR(255),
keyphrases VARCHAR(255),
keywords VARCHAR(255))”;
mysqli_query($conn, $sql);
““

Then how to write such text code to amend the tbl ?
Like add a new column ?
Delete a column ?
Rename a column ?
Switch a NULL column to NOT NULL and vice versa ?
How to switch col type ? Like from VARCHAR to TinyText ?
How to add a column for img ?
How to add a column for videos ?

Show us an example.

Thanks

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@developer_webauthorAug 01.2020 — CREATE TABLE Sample

(

sample_id int NOT NULL,

sample_name VARCHAR(20),

sample_ts TIMESTAMP

);

Grabbed from here:

https://www.webdeveloper.com/d/390795-why-no-result-displayed-from-db/25
Copy linkTweet thisAlerts:
@SempervivumAug 01.2020 — Your questions are answered here, e. g.:

https://www.w3schools.com/sql/sql_alter.asp
Copy linkTweet thisAlerts:
@developer_webauthorAug 26.2020 — @Sempervivum#1621619

Thanks. Reading this nearly after a month.
×

Success!

Help @developer_web spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...