Jump to content

Recommended Posts

Hi,

I'm trying to modify a search code but I'm not able to get any results and I'm not getting any errors.

 

The page is supposed to allow the user to search by one or multiple fields and return the according results.

 

The code was originally using the depreciated MySQL and I was trying to modify to MYSQLI.

 

I'm not sure that I'm using it correctly.

 

I have attached the files. If anyone can look at it and possibly correct it I'd greatly appreciate it.

 

Attached Files:

index.html - User Search Page

search.php - Search Code

Users.txt - Data I've been using (rename to csv).

 

I'm using WAMP.

 

Thanks,

Mitka

index.html

search.php

Users.txt

Place this the top of your search.php and see if any errors

error_reporting(E_ALL | E_NOTICE);
ini_set('display_errors', '1');

You have a $conn instead of $con line 7 in search.php

 

Try that and can look more if need it.

if would help if you told us or showed us what output you are getting. just telling us you are getting no result can mean a number of different things. what output are you getting from the code?

 

as to the mysqli code, your connection and connection error checking is a mix of procedural and oop usage that isn't correct. it also looks like it had a trigger_error() statement in it at one point that got removed. the php.net documentation contains examples of using procedural code to make a connection and testing if the connection worked. you should start by reading the documentation.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.