Hi all,
Im at a loss here. There are definitly a lot of emails repeated in the table, but it just wont echo out anything.
all help is appreciated -
<?php
-
session_start();
-
include "connect.php";
-
$name = $_SESSION['name'];
-
$email = $_SESSION['email'];
-
$nationality = $_SESSION['country'];
-
$query = "SELECT * FROM tbl_beta WHERE email =' $email'" or die(mysql_error());
-
$result = mysql_query($query);
-
$unique = mysql_num_rows($result);
-
if($unique > 1){
-
echo "Sorry, That email has already been registered in out database. Please contact support at ";
-
exit();
-
}else{
-
$SQL = "INSERT INTO tbl_beta (name, email, nationality) VALUES ('$name', '$email', '$nationality')";
-
$result = mysql_db_query($db,$SQL,$cid);
-
echo "Thanks for registering " . $name;
-
echo "<br>We will be in touch shortly.";
-
$_SESSION['betaemail'] = $email;
-
include "mail.php";
-
}
-
?>
-
1 1264 Markus 6,050
Recognized Expert Expert
I imagine that space before $email is causing your problem (line 7).
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Matt Schroeder |
last post by:
Does anyone know how to count how many rows are in a mysql table? This is
what I have, but it doesn't work right:
<?
$db = mysql_connect("localhost", "username", "password");
mysql_select_db("database",$db);
$sql = "SELECT COUNT(*) FROM table";
$result = mysql_query($sql);
echo "$result";
?>
|
by: Reply via newsgroup |
last post by:
Folks,
When performing an update in mysql (using PHP), can I find out how many
records were matched?
mysql_affected_rows() won't work... and I have the following problem
that I thought I could resolve with a simple function:
Example:
I have 50records - I want to update a selection of the recods - some,
|
by: Chris Stromberger |
last post by:
When issuing updates in mysql (in the console window), mysql will tell
you if any rows matched and how many rows were updated (see below). I
know how to get number of rows udpated using MySQLdb, but is there any
way to get the number of rows matched? I want to find out, when rows
updated = 0, if there were no updates because the row wasn't...
|
by: hshen |
last post by:
Hi All,
I have encountered a weird behavoir of embedded MySQL. Through a
simple program I made (in Delphi 6), I can insert rows to a table
through embedded MySQL and I can retrieve the rows from my program.
But using mysql.exe which points to the same table (through 127.0.0.1,
with the same basedir and datadir), I cannot see the rows I...
|
by: Ike |
last post by:
How can I make a query such that in the "WHERE" part of my clause, I want to
put something to the effect that, say, X days have elapsed since a given
date.
For example, suppose in my table, I have a boolean field and a date field.
I want to create a query asking for those rows where X days have elapsed
from the date field in a row and the...
| |
by: walexand |
last post by:
I use the database mysql v.4.
My problem is...
I have a select like:
select * from user where language = "de";
the result are then:
id name
===================
1 max
|
by: Peter |
last post by:
Hi,
This post is about counting rows and finding the max count in a group of rows.
I'm trying to find the player who scored the most goals in a game.
I know how to find out how many goals the players scored, but I do not know
how to find the player who scored the most goals in a specific game.
The tables:
|
by: Dejan |
last post by:
Hy,
Sorry for my terreble english
I have this simple code for deleting rows in mysql table...
Everything works fine with it.
So, what do i wanna do...:
my sql table looks something like this:
id Name Surname pictr0 picrt1 pictr2
pictr3
|
by: geon |
last post by:
Hi!
I have a table I'm using as a stack to pop rows from. (The data in the stack is precomputed for efficiency and reliability.) There are a lot of duplicate rows in this table (hundreds or thousands of identical rows), but they are all inserted with a regular insert statement.
I have optimized it by using the multiple row insert syntax:
...
|
by: lisles |
last post by:
i have a page funtion.php which hs the function to connect to the db
/* Mysql Connection */
function connect(){
global $db_server,$db_user,$db_pass,$db;//Global Values from the config.php
$conn = @mysql_connect($db_server,$db_user,$db_pass) or die("Connection to Database Server Failed");
@mysql_select_db($db) or die("Database Selection...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |