Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 How to connect php to database

views
     
turnmoil
post Feb 26 2019, 10:07 AM

Casual
***
Junior Member
420 posts

Joined: Jan 2003
From: The Miau Miaw Niau Miow Land


QUOTE(bloodchow2 @ Feb 26 2019, 04:21 AM)
greetings, im from engineering background, this is my usual php-mysql script for querying (most of the time i use phpmyadmin tho) :

» Click to show Spoiler - click again to hide... «


edit $loop to repeat the query, 1 for single time, 1000 if u want repeat 1000
delete all my $sql variable and replace yours, or drop all your database with this also can  thumbup.gif  thumbup.gif
edit 'localhost' 'root' '' '' with yourhost,db user, db password, db name

thats it! remember this is not prepared statement and susceptible to SQL injection! use this script for testing only
*
great code insight thumbup.gif should check is it able to connect or not to db

TSmissmataleo
post Feb 26 2019, 12:11 PM

Getting Started
**
Junior Member
99 posts

Joined: Jun 2013
QUOTE(bloodchow2 @ Feb 26 2019, 04:21 AM)
greetings, im from engineering background, this is my usual php-mysql script for querying (most of the time i use phpmyadmin tho) :

» Click to show Spoiler - click again to hide... «


edit $loop to repeat the query, 1 for single time, 1000 if u want repeat 1000
delete all my $sql variable and replace yours, or drop all your database with this also can  thumbup.gif  thumbup.gif
edit 'localhost' 'root' '' '' with yourhost,db user, db password, db name

thats it! remember this is not prepared statement and susceptible to SQL injection! use this script for testing only
*
thanks for the guide. im currently handling yii framework. need alot of training.
bloodchow2
post Feb 26 2019, 05:11 PM

On my way
****
Senior Member
664 posts

Joined: Mar 2013
QUOTE(turnmoil @ Feb 26 2019, 10:07 AM)
great code insight  thumbup.gif  should check is it able to connect or not to db
*
thanks mate rclxms.gif rclxms.gif

code guaranteed to work, i have used it like 30+ time d, just db details must correct will do

QUOTE(missmataleo @ Feb 26 2019, 12:11 PM)
thanks for the guide. im currently handling yii framework. need alot of training.
*
np, just keep learning, you can get most of them just googling, if question too tough can try ask here, many sifu here to help you icon_idea.gif

 

Change to:
| Lo-Fi Version
0.0175sec    0.44    5 queries    GZIP Disabled
Time is now: 29th March 2024 - 07:47 AM