Can anybody help an old man.

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

Can anybody help an old man.

Postby allenjames » 14. February 2023 13:12

Good Day Everyone !!

Im trying to resurrect an old website that tracks radio contacts.

Ive been sent a website template from a friend, who uses old php and mysql.

Im slowly converting it to work in XAMPP, and to my surprise I am actually doing quite well.

However one page is giving me some grief.

If I comment out this section, the page loads, but obviously there is no data in the tables.

If I uncomment this section, i get HTTP500, the server can't process this request.

Any pointers as what could be wrong ?


Code: Select all
<?php
$resultF = mysqli_query()(SELECT "txcallsign, name, section, txserial, count(distinct dxccdesc) as score, sum(cw) as tcw, sum(voice) as tvoice, sum(data) as tdata, sum(internet) as tinternet FROM dxqsos2023 join callsignshny where txcallsign = callsign AND section = 'Foundation' group by txcallsign order by count(distinct dxccdesc) desc") or die(mysqli_error());
$numF=mysqli_num_rows($resultF);
$resultI = mysqli_query(SELECT "txcallsign, name, section, txserial, count(distinct dxccdesc) as score, sum(cw) as tcw, sum(voice) as tvoice, sum(data) as tdata, sum(internet) as tinternet FROM dxqsos2023 join callsignshny where txcallsign = callsign AND section = 'Intermediate' group by txcallsign order by count(distinct dxccdesc) desc") or die(mysqli_error());
$numI = mysqli_num_rows($resultI);
$resultA = mysqli_query(SELECT "txcallsign, name, section, txserial, count(distinct dxccdesc) as score, sum(cw) as tcw, sum(voice) as tvoice, sum(data) as tdata, sum(internet) as tinternet FROM dxqsos2023 join callsignshny where txcallsign = callsign AND section = 'Advanced' group by txcallsign order by count(distinct dxccdesc) desc") or die(mysqli_error());
$numA = mysqli_num_rows($resultA);
$resultS = mysqli_query(ELECT "txcallsign, name, section, txserial, count(distinct dxccdesc) as score, sum(cw) as tcw, sum(voice) as tvoice, sum(data) as tdata, sum(internet) as tinternet FROM dxqsos2023 join callsignshny where txcallsign = callsign AND section = 'SWL' group by txcallsign order by count(distinct dxccdesc) desc") or die(mysqli_error());
$numS = mysqli_num_rows($resultS);
$totvoice =  mysqli_query(SELECT "count(ID) as totvoice FROM dxqsos2023 where mode = 'Voice'");
$totdata = mysqli_query(SELECT "count(ID) as totdata FROM dxqsos2023 where mode = 'Data'");
$totcw = mysqli_query(SELECT "count(ID) as totcw FROM dxqsos2023 where mode = 'CW'");
$totinternet = mysqli_query(SELECT "count(ID) as totinternet FROM dxqsos2023 where mode = 'Internet'");
$tdxcc =  mysqli_query(SELECT "count(distinct dxccdesc) as totdxcc FROM dxqsos2023");
?>
allenjames
 
Posts: 3
Joined: 14. February 2023 13:07
XAMPP version: 8.2-0-0
Operating System: Mac OS 11.1 Big Sur

Re: Can anybody help an old man.

Postby Altrea » 14. February 2023 13:42

Hi,

Where should i start?

  • Why are the SELECTs not inside the double quotes?
  • Why is there an extra pair of brackets in the first SELECT?
  • Why is there an ELECT instead of a SELECT?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Can anybody help an old man.

Postby allenjames » 14. February 2023 14:39

I have no idea. . .

Its how it was sent to me, I've been scouring through, I did notice the ELECT to be honest, but I copied this from his original.

As I said, I am open to any pointers, not necessarily the answer but any input is great.

Thanks.
allenjames
 
Posts: 3
Joined: 14. February 2023 13:07
XAMPP version: 8.2-0-0
Operating System: Mac OS 11.1 Big Sur

Re: Can anybody help an old man.

Postby Altrea » 14. February 2023 15:02

We do not know either, but that is not valid PHP or valid SQL.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11933
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Can anybody help an old man.

Postby allenjames » 14. February 2023 18:55

thanks for your help.
allenjames
 
Posts: 3
Joined: 14. February 2023 13:07
XAMPP version: 8.2-0-0
Operating System: Mac OS 11.1 Big Sur

Re: Can anybody help an old man.

Postby Nobbie » 14. February 2023 19:36

allenjames wrote:Its how it was sent to me


Ok, then ask the "sender" why he sent total bullshit. Thats not valid PHP, that is what we call "Müll" (trash) in Germany. Thats nothing, so many errors and so obvious errors, thats totally useless trash.
Nobbie
 
Posts: 13176
Joined: 09. March 2008 13:04


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 42 guests