Skip to content
View in the app

A better way to browse. Learn more.

Tip.It Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MySQL Database/Variables

Featured Replies

Quick question for people out there. I'm more of a script kiddie than I am a database programmer, but I know my share of MySQL coding. Here's my question:

 

 

 

 

 

 

 

If I create the table in database "theftus1_fire", how would I define and bring up a variable on a php page without comprimising the database username, and password? I'm trying to make my website completely MySQL and I want to be able to insert data into the MySQL database/table and have it brought up on the website without typing it out into HTML (HTML text, etc.)

 

 

 

 

 

 

 

Thanks to whoever looks into this.

You'll have to type the username into plain text but if you do it in a PHP file there's less security risk since PHP isn't viewable like HTML.

 

 

 

 

 

 

 




//config.php



<?php



   $user      = 'username';



   $pass      = 'password';



   $db         = 'database_name';



   $table      = 'table_name';



   $server    = 'localhost';



?>

 

 

 

 

 

 

 

 

 

 

 

<?php



   include('config.php');



   mysql_connect($server,$user,$pass) or die('Make sure your server, username and password are correct.');



   //rest of code here



 

 

 

 

 

 

 

That should be sufficient.

 

 

 

 

 

 

 

mysql_select_db($db);

  • Author

I know the code to connect to a database, but how do you include variables listed in a table, or just a table alone. Is there an echo or "longtext.vcar" code for it to echo a variable?




echo $row['variable'];



 

 

 

 

 

 

 

that should work




echo $row['variable'];



 

 

 

 

 

 

 

that should work

 

 

 

 

 

 

 

Assuming of course that $row is a valid reference to a row in the table ;)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.