Information need within Config.php - Forum

Forum Navigation
You need to log in to create posts and topics.

Information need within Config.php

What is the least amount of information needed within the Config.php file to load and do a search of a database.

All I want to do is search the databbase table "AZcode" and show the information on the app.

the tabke is "AZcode" and field is "postcode".

Sorry for the way this has been written but this is the third time that I have tried to post this.

 

 

@m-burdess this should be the minimun you need. I suppose you are using a MySQL database whose file name is mydatabase.db

//SQLite database setup
$dbAlias[0]="db1";
$dbNames[0]="mydatabase.db";

//Select query
$sqlAlias[0]="select";
$sqlQuerys[0]="SELECT * FROM AZcode";
$sqlMaxUserLevel[0]=-1;

Please take a look at the YouTube tutorial for more information.

Regards.

@luishp sorry for the delay answering.  The database is on the CloudNeo Control MySQL, show as "trainman_postcode"  with a Table "AZcode" , field "postcode".

When I posted this question I did try to post the code I have work on but the system would not let me. ( and again today )

This is my first try to use MySQL within VisualNeo,and just wanted to have the code looked at, and give a an pointers to the best way to code a datbase.

 

Regards

@m-burdess this should be the code to connect to your MySQL database. Just change realDatabaseName, MySQLUserName and MySQLUserPassword with your real database name, user and password respectively:

//MySQL sample
$dbAlias[0]="db1";
$dbNames[0]="realDataBaseName";
$dbServerNames[0]="localhost";
$dbUserNames[0]="MySQLUserName";
$dbPasswords[0]="MySQLUserPassword";

//Select query
$sqlAlias[0]="select";
$sqlQuerys[0]="SELECT * FROM AZcode";
$sqlMaxUserLevel[0]=-1;

Also be sure the PHP extensions for MySQL PDO is activated using your CloudNEO control panel.
If you need to share sample code, please save it to a file, zip it and attach it here, so it's not blocked by the security system.
Go to Advanced > PHP Settings > Edit php.ini > Advanced mode (take a look at the attached picture)

Regards.

Uploaded files:
  • You need to login to have access to uploads.