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

  • SEARCH
  • Home
  • 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 6254837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:15:13+00:00 2026-05-24T14:15:13+00:00

im learning php and to keep it simple (i think), this is what im

  • 0

im learning php and to keep it simple (i think), this is what im trying to do below.

–Work so far:

I made a small mini form and what i want to do is that when the person enters their email address, that a few things happen:

  1. display a dummy message with actual first name based on database info gotten from email entered.
  2. delete DB row based on email entered.

the process page that comes next has a custom message like ” hello NAME HERE, sorry to see you go blah blah”

Now i havent written the account deletion part because im getting an error. i don’t get syntax or any other errors in DW or Aptana..just when i test.
the error that i receive is: Notice: Use of undefined constant mysqli_error – assumed ‘mysqli_error’ in line 32 which is this line that has

$sn_nameQueryStringResults = mysqli_query($connect2db, $sn_nameQueryString) or die( "Sorry but theres a connection to database error" . mysqli_error);

this is what i have so far for the form:

<form method="post" action="snDelAcc_proc.php">
<table width="500" border="0">
    <tr>
        <td>Enter your email address here:</td>
        <td>
        <input type="text" name="accDel" width="250" >
        </td>
    </tr>
    <tr>
        <td>
        <input type="submit" name="submit">
        </td>
    </tr>

</table>

and this is the process page:

<?php




// - - connect to db.
$connect2db = mysqli_connect('127.0.0.1','root','passhere','dbtest');
if(!$connect2db){
    die("Sorry but theres a connection to database error" . mysqli_error);
}

//get emailfrom first page.
$emailaddy = $_POST['accDel'];


$sn_nameQueryString = " SELECT FROM email_list WHERE email = '$emailaddy'";




$sn_nameQueryStringResults = mysqli_query($connect2db, $sn_nameQueryString) or die( "Sorry but theres a connection to database error" . mysqli_error);




//get the name with fetch
$actualFnameGet = mysqli_fetch_array($sn_nameQueryStringResults);
//$sn_query = " DELETE FROM email_list WHERE email= ";


echo $actualFnameGet['firstname'];


?>

any ideas as to why im wrong?
Im a bit lost, thanks in advance.

  • 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-24T14:15:15+00:00Added an answer on May 24, 2026 at 2:15 pm

    First of all, your error can’t be printed because mysqli_error is a function, so you have to write mysqli_error().

    Second, you have an error in your query: Either enter all the fields you want or simply a *:

    SELECT * FROM email_list WHERE email = ...
    

    Last but not least, your query is very vulnerable to sql injections by putting the post variable $emailaddy directly into the query without escaping it, so you should use:

    "SELECT * FROM email_list WHERE email = '".mysqli_real_escape_string($emailaddy)."'";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I Am just learning PHP and loving it so far. I have this code
I am pretty new to php, but I am learning! I have a simple
I keep reading about defficiencies and issues with languages. Specifically, I'm learning PHP and
I am learning PHP and SQL, and I'm trying to figure out how to
I am new to PHP (still) and keep learning. I often have to retrieve
I'm just learning PHP and I'm trying to figure out how I could store
I'm learning PHP OOP and Im trying to understand why the following script doesn't
I want to start learning php, I install apache 2.2 and I want to
I am just learning PHP . i want to display string like 32th meet
How would I keep javascript and php code from being entered into a form

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.