close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

MySQLi query where target from $_GET[] Query not returning values on page

Thread began 11/05/2019 6:58 pm by Michael | Last modified 11/06/2019 10:55 pm by Ray Borduin | 39 views | 6 replies |

Michael

MySQLi query where target from $_GET[] Query not returning values on page

Hello Support,

Please my MySQLi query where target from $_GET[] Query not returning values on page. Please see code below

<?php
$rsValidateParticipant = new WA_MySQLi_RS("rsValidatet",$DBMS,10);
$rsValidateParticipant->setQuery("SELECT regno, title, surname, othernames, state, country, assembly, sex, maritalstatus, age, phone, email, @curRow := @curRow + 1 AS sn FROM registration JOIN (SELECT @curRow := 0) r WHERE assembly = ? ORDER BY assembly ASC");
$rsValidateParticipant->bindParam("s", "".(isset($_GET['assembly'])?$_GET['assembly']:"") ."", "-1"); //colname
$rsValidateParticipant->execute();
?>

The code is to pull all records based on the selected Assembly but when the assembly is selected from the drop down menu, nothing happens; no data is loaded on the page

Attached is the page.

Thank you

Sign in to reply to this post

Ray BorduinWebAssist

I'm not familiar with the SQL syntax you are using. Does it work to return all rows when you remove the parameter and WHERE Clause?

You can write the resulting SQL statement to the page like:

php:
<?php echo($rsValidateParticipant->debugSQL()); ?>



Then you can copy and paste that SQL statement into phpMyAdmin and debug it there to see if the parameter is set correctly and if there is something else wrong with the SQL statement.

Sign in to reply to this post

Michael

Originally Said By: Ray Borduin
  I'm not familiar with the SQL syntax you are using. Does it work to return all rows when you remove the parameter and WHERE Clause?

You can write the resulting SQL statement to the page like:

php:
<?php echo($rsValidateParticipant->debugSQL()); ?>


Then you can copy and paste that SQL statement into phpMyAdmin and debug it there to see if the parameter is set correctly and if there is something else wrong with the SQL statement.  
Sign in to reply to this post

Michael

The code <?php echo($rsValidateParticipant->debugSQL()); ?> is not showing any error but rather echoing the SQL statement.

This SQl statement "SELECT regno, title, surname, othernames, state, country, assembly, sex, maritalstatus, age, phone, email, @curRow := @curRow + 1 AS sn FROM registration" runs perfectly well on phpMyAdmin

Sign in to reply to this post

Ray BorduinWebAssist

What about after adding the where clause. Does the SQL statement look correct and return the correct rows on phpMyAdmin then?

Sign in to reply to this post

Michael

Originally Said By: Ray Borduin
  What about after adding the where clause. Does the SQL statement look correct and return the correct rows on phpMyAdmin then?  




Yes sir

Sign in to reply to this post

Ray BorduinWebAssist

I'll need FTP access and a URL to fully debug. If the query looks right and returns a result in php myAdmin, then it should work.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...