how to save value from prompt to database in php
shashanknaik1
0
Newbie Poster
Recommended Answers
Jump to PostIf you have to add row in database, you can use following code
$dsn = 'mysql:dbname=testdb;host=127.0.0.1'; $user = 'dbuser'; $password = 'dbpass'; try { $dbh = new PDO($dsn, $user, $password); /* Add new row in table FRUIT */ $count = $dbh->exec("INSERT INTO fruit (id,name) VALUES(1,'banana')"); /* Show …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.