Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6705613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:25:27+00:00 2026-05-26T07:25:27+00:00

I have two php files. Here is one and the code: <?php require_once(‘../includes/php.config.db.php’); //here

  • 0

I have two php files.

Here is one and the code:

<?php
require_once('../includes/php.config.db.php');

//here i have a script (xpath) for exctracting data (work 100%)

  $naslov = $data['naslov'];
  $latitude = $data['lat'];
  $longitude = $data['lng'];
  $latitude = (float) $latitude;
  $lin = $data['link'];
  $vreme = $data['vreme'];

  $popust = str_replace ('POPUST','',$data['popust']);
  $firma = $data['firma']; 
  $telefon = $data['telefon'];
  $email = $data['email'];
  $sajt = $data['sajt'];
  $type = 'bar';


  $latitude = (float) $latitude;
  $longitude = (float) $longitude;

//end 

?>

The second file is php.config.db.php which i call above:

<?php

$link = mysql_connect('localhost', 'user', 'pass') or die('<p>Nije moguce uspostaviti konekciju sa database serverom!</p>');

mysql_select_db('tablename', $link);

mysql_query("SET NAMES utf8");

mysql_query("SET CHARACTER SET utf8");

mysql_query("SET COLLATION_CONNECTION='utf8_general_ci'");



function insertNewMarker($name='', $lat='', $lng='', $slika='', $link='', $type='', $popust='', $vaziDo='') {

    if(!empty($name) and !empty($lat) and !empty($lng) and !empty($link)) {

        $name = mysql_real_escape_string(trim($name));



        $sql = "INSERT INTO `markers` (`name`, `lat`, `lng`, `address`, `totolink`, `type`, `popust`, `vaziDo`) <br />

VALUES ('$name', '$lat', '$lng', '$slika', '$link', '$type', '$popust', '$vaziDo')";

        mysql_query($sql) or print "<p>Error in SQL Statement ($sql):<br />". mysql_error() .'</p>';

    }

    else {

        print "<p>Polja 'name', 'lat' i 'lng' ne smiju biti prazna!<br />Vi ste uneli <br />Name:$name<br />Lat:$lat<br />Lng:$lng</p>";

    }

}

?>

but when i start php file only i get a white screen without error and my database is empty. WHY? (sorry for my english)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:25:28+00:00Added an answer on May 26, 2026 at 7:25 am

    You have a <br/> tag in your SQL INSERT statement

     $sql = "INSERT INTO `markers` (`name`, `lat`, `lng`, `address`, `totolink`, `type`, `popust`, `vaziDo`) <br />
    
    VALUES ('$name', '$lat', '$lng', '$slika', '$link', '$type', '$popust', '$vaziDo')";
    

    It should be something like:

     $sql = "INSERT INTO `markers` (`name`, `lat`, `lng`, `address`, `totolink`, `type`, `popust`, `vaziDo`) VALUES ('$name', '$lat', '$lng', '$slika', '$link', '$type', '$popust', '$vaziDo')";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three files in a folder 'test' one.php two.php print.html And i have
I have two files, one containing an array in PHP that is echo ed
The setup: I have a standard .php file (index.php) that contains two includes, one
I have two PHP files that I need to link. How can I link
i have two files:(localhost/template/) index.php template.php each time when i create an article(an article
I am confused with & and && . I have two PHP books. One
I have created two simple files in php. first file (i.e. input.php ): Created
I have two dev servers, one is PHP version 5.3.1 which is on my
In a folder named rewrite I have two files, .htaccess and index.php <rewrite> -
I have a PHP file, Test.php, and it has two functions: <?php echo displayInfo();

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.