Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Other Programming › PHP Programming › PHP and Databases #1

SmilePHP and Databases #1

Posts 1–4 of 4 · Page 1 of 1
yearupie
yearupie
PHP and Databases #1
Best Forumer,

I want to say beforehand that this tutorial I've written in Dutch, then I got it through google translated into English. Please understand this.

Caution! I make notes and explanations in scripts.

Well I want you to lay out how you can call a database with PHP.
The most common method is to use MySQL. Most hosting sites support this feature.

Chapter 1: Connect to the database

To connect to the database, we use the following code snippet:

[php]<?php
/* Database settings */
$db = array (
'host' => 'localhost', // Hostname
'user' => 'root', // Username
'pass' => '', // Password
'dbname' => 'test' // Database name
);

/* Connect to database */

# Make connection
if(!mysql_connect($db['host'], $db['user'], $db['pass']))
{
// Can't connect!
trigger_error('Error while connecting: '.mysql_error());
}
# Select database
elseif(!mysql_select_db($db['dbname']))
{
// Can't connect database!
trigger_error('Error while selecting database: '.mysql_error());
}
else
{
// Connected to database
// ...
// ...
}
?>[/php]

This was Chapter 1, soon I will go to the next chapter.
#1 · edited 16y ago · 16y ago
Lost-Shadow
Lost-Shadow
:O, Why make a MySQL Based one,
It makes like many more errors then a MsSQL Based one !
#2 · 16y ago
MA
mast3rdoom
Many people use MySQL more so than MsSQL because most free and paid hosts make you use PHPMyAdmin -- MySQL. Although, some hosts do offer the ability to utilize MsSQL. I, personally, prefer MySQL.
#3 · 16y ago
Bryci
Bryci
Quote Originally Posted by Lost-Shadow View Post
:O, Why make a MySQL Based one,
It makes like many more errors then a MsSQL Based one !
Many people use MySQL instead of MsSQL because MySQL is more flexable. One of the upsides of MySQL is the PHPMyAdmin feature which offers easy database manipulation.
#4 · 16y ago
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

  • PHP and MathBy Ugleh in PHP Programming
    3Last post 16y ago
  • [Question] VB.NET and Databases.By Erinador in Visual Basic Programming
    5Last post 16y ago
  • [Request]Vb/PHP database interactionBy Gilcrow in Visual Basic Programming
    0Last post 16y ago
  • i need short icq number pls and hack to wr..By BoneXDBreaker in WarRock - International Hacks
    1Last post 20y ago
  • Lineag2 and RagnarokBy suppaman in General Gaming
    12Last post 20y ago

Tags for this Thread

None