Hi I can't understand why when I execute a query :
$select = "SELECT nom_utilisateur, mot_de_passe,
nom,prenom,date_de_naissance,
site_internet,avatard,email FROM utilisateur
WHERE nom_utilisateur = '$nom_utilisateur'";
$req = mysql_query($select) or die('Erreur SQL !');
$nom = mysql_result($req,0,"nom");
$prenom = mysql_result($select,0,"prenom");
$adresse = mysql_result($select,0,"adresse");
$email = mysql_result($select,0,"email");
I only can print $nom value anybody see ?
thanks in advance 2 1420
.oO(Alexandre) Hi I can't understand why when I execute a query :
$select = "SELECT nom_utilisateur, mot_de_passe, nom,prenom,date_de_naissance, site_internet,avatard,email FROM utilisateur WHERE nom_utilisateur = '$nom_utilisateur'"; $req = mysql_query($select) or die('Erreur SQL !'); $nom = mysql_result($req,0,"nom"); $prenom = mysql_result($select,0,"prenom"); $adresse = mysql_result($select,0,"adresse"); $email = mysql_result($select,0,"email");
I only can print $nom value anybody see ?
You're passing $select instead of $req to the mysql_result() function.
Didn't PHP complain about that? Is error_reporting set to E_ALL?
You might also want to have a look at mysql_fetch_assoc(), would be much
easier and probably faster.
Micha
On 2005-01-20, Alexandre <wh**@msn.com> wrote: Hi I can't understand why when I execute a query :
$select = "SELECT nom_utilisateur, mot_de_passe, nom,prenom,date_de_naissance, site_internet,avatard,email FROM utilisateur WHERE nom_utilisateur = '$nom_utilisateur'"; $req = mysql_query($select) or die('Erreur SQL !'); $nom = mysql_result($req,0,"nom"); $prenom = mysql_result($select,0,"prenom"); $adresse = mysql_result($select,0,"adresse"); $email = mysql_result($select,0,"email");
I only can print $nom value anybody see ?
You're saying:
$nom = mysql_result($req,0,"nom");
^^^^
But then you're saying:
$prenom = mysql_result($select,0,"prenom");
^^^^^^^
You might want to look into mysql_fetch_array() though.
--
Cheers,
- Jacob Atzen This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Lozarythmic |
last post by:
Hello all,
I'm having a slight problem with a script i created at work. All was
fine until one day i decided i'd work on it at home, so i set up the
same apache server (2.0.49) and php (4.3.3)...
|
by: bettina |
last post by:
The program works local ok. The data were found in the datenbank and
display by the program.
When I wanted to test my program online, I get the following message:
mysql_result(): supplied argument...
|
by: James |
last post by:
Hi
I am having some trouble getting a asp page to load. Im a
noob to the asp side. I have followed knowledege base
Article 301305. I am running 2000 adv, IIS 5.0
I have the following...
|
by: Jim Bancroft |
last post by:
Hi everyone,
I'm running into a problem with my ASP.Net application. I've just created a
new aspx page which uses some new components of mine that inherit from
ServicedComponent and are...
|
by: Daniel Walzenbach |
last post by:
Hi,
I have a web application which sometimes throws an “out of memory”
exception. To get an idea what happens I traced some values using performance
monitor and got the following values (for...
|
by: Olivier BESSON |
last post by:
Hello,
I have a web service of my own on a server (vb.net). I must declare it with
SoapRpcMethod to be used with JAVA.
This is a simple exemple method of my vb source :
...
|
by: Steve |
last post by:
Trying to do a pretty simple page where I display car parts on a page based on the category selected from a drop down list. Here's my tables setup:
categories
code CHAR(3)
description (25)
...
|
by: JLupear |
last post by:
I am having trouble with my code again, I had prepared a question and the code to upload, however I am having trouble posting it, are there limits to the amount of lines you can post?
I split it...
|
by: mrchatgroup |
last post by:
news from
http://www.mrchat.net/myblog/myblog/small-accidents-mean-big-trouble-for-supercollider.html
Small Accidents Mean Big Trouble for Supercollider
Image
Scientists expect startup...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |