#1 2016-07-02 11:58:41

wildair
Member
Registered: 2016-07-02
Posts: 12

.sql file in database sample

hello,

please tell me what to do with .sql file in your database sample. i have uploaded all scripts related database project in my own webhosting, but when i run the project it shows connecting error. i add my url in httpclient, but how can i use database.sql file.

thank you.

Offline

#2 2016-07-02 15:27:11

tin
Member
Registered: 2016-03-20
Posts: 161

Re: .sql file in database sample

import .sql to your phpmyadmin host or other tool to manage mysql database and edit Initialize.php as your hosting connection.That it all set.

Offline

#3 2016-07-02 19:32:58

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: .sql file in database sample

Hello to all,

tin wrote:

import .sql to your phpmyadmin host or other tool to manage mysql database and edit Initialize.php as your hosting connection.That it all set.

That's correct. The SQL file contains the database structure (in fact just one table) to be recreated in your own database, using the PhpMyAdmin import, for example. Thanks for your help Tin!

Offline

#4 2016-07-03 04:15:55

wildair
Member
Registered: 2016-07-02
Posts: 12

Re: .sql file in database sample

Thank you tin and david for info, i did as advised but still i get error. please see image.

error.jpg

Offline

#5 2016-07-03 04:17:47

wildair
Member
Registered: 2016-07-02
Posts: 12

Re: .sql file in database sample

i am unable to send you image

Offline

#6 2016-07-03 07:54:42

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: .sql file in database sample

Hello,

Sorry, but the image link you provide is not correct:

You can use here the "img" tags, but you must provide a valid URL for that.

Or maybe you want to use the upload feature available in this forum too.

Offline

#7 2016-07-03 09:05:06

wildair
Member
Registered: 2016-07-02
Posts: 12

Re: .sql file in database sample

Thank you for your kind support. This is the error i got.

error.gif

Offline

#8 2016-07-03 12:16:05

wildair
Member
Registered: 2016-07-02
Posts: 12

Re: .sql file in database sample

this is my initialize.php file. what i am doing wrong?

<?php

// Hide all PHP errors (useful, we never wanted to show error in production code)

error_reporting(0);

ini_set('display_errors', 0);

// Enable CORS ([url]http://enable-cors.org/server_php.html[/url])

header('Access-Control-Allow-Origin: *');

if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {

  if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']))

    header("Access-Control-Allow-Methods: GET, POST, OPTIONS");

  if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']))

    header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");

  exit;

}



// Require our Database class

require 'Database.php';



// Try to connect with the database

try {

  Database::connect('mysql:host=www.spacepage.in;dbname=spacepag_dec_appbuilder', 'username', 'password');

} catch (Exception $e) {

  // And exit the script execution here if we cannot connect

  http_response_code(500);

  echo 'Can\'t connect to the database!';

  exit;

}

Offline

#9 2016-07-03 20:00:02

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: .sql file in database sample

Hello wildair,

Sorry for the delay. I expend all the day into the hospital with my mom. Certainly the problem is we can't connect to the database, but, we have not too much information. But anyway, apparently the problem is with the database connection, so we must assert the database exists, the user is associated with that database, and also have the appropiate "read" security attributes. In few words, the problem is when "Database::connect()", then, something is wrong here, something does not match (The user? The password? The user privileges?).

Offline

#10 2016-07-04 03:46:27

wildair
Member
Registered: 2016-07-02
Posts: 12

Re: .sql file in database sample

PLEASE DO NOT SAY SORRY. I AM SORRY TO DISTURB YOU. I will try. Thank You.

Offline

#11 2016-07-04 17:18:25

wildair
Member
Registered: 2016-07-02
Posts: 12

Re: .sql file in database sample

not working, changed every thing! please tell me is user in the initialize.php is mysql database user or the hosting username? i both changed but same problem!

Offline

#12 2016-07-04 23:24:49

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: .sql file in database sample

Hello wildair,

Sorry again for the delay. Please, try to change "host=www.spacepage.in;" to "host=localhost;".

Offline

#13 2016-07-05 04:03:27

wildair
Member
Registered: 2016-07-02
Posts: 12

Re: .sql file in database sample

Hello david,
I hope everything is good! i have the database and user shown in the picture below.
user.jpg

i am sending you the project file, please review. thank you.
Database.zip

Offline

#14 2016-07-05 18:23:09

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: .sql file in database sample

Hello wildair,

Ok. Apparently the problem is related with the HTTPS protocol. I try replacing "http://www.skynetindia.in" by "https://www.skynetindia.in" in all the application and finally the application can connect with the database.

Of course maybe you want to use the "https" protocol, but, in this case, you need to solve the problems that apparently have. This is the error message than appear in the Firefox console when try to connect using "https":

www.skynetindia.in uses a non valid certificate

The certificate is only valid for these names:
  *.websitewelcome.com, websitewelcome.com 

Error code: SSL_ERROR_BAD_CERT_DOMAIN

Offline

#15 2016-07-08 13:47:53

wildair
Member
Registered: 2016-07-02
Posts: 12

Re: .sql file in database sample

where did you replace "http://www.skynetindia.in" in application, kindly tell me!

Offline

#16 2016-07-08 13:50:46

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: .sql file in database sample

Hello wildair,

Yes; of course. We must replace that in every Http Client calls, however, since I perfectly know what wanted, I just open the ".ab" file with my Small Editor (any other may can achieve that too) and just use the search and replace feature, searching by "https://www.skynetindia.in" and replacing it by "http://www.skynetindia.in". If you want to send me the ".ab" file I can do for you without problems.

P.S. The ".ab" project file of our applications are XML files that can be opened with text editors (which can deal with UTF-8) to do task like this. App Builder incorporates a "Search in apps" feature, but not a "Search and replace in apps" feature yet.

Offline

#17 2016-07-10 03:18:12

wildair
Member
Registered: 2016-07-02
Posts: 12

Re: .sql file in database sample

Thank you david. i got it done. you and your program is awesome. Thank you for your kind support.GOD BLESS.

Offline

#18 2016-07-10 09:24:10

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,660
Website

Re: .sql file in database sample

Hello wildair,

Glad to know you got it. And thanks for your kindly words. Please, consider to purchase an App Builder license: that's the way to maintain the project up to date and well maintained! Thanks very much in advance for your support wildair.

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.