The new documentation build system is ready for testing

The PHP documentation team is pleased to announce the initial release of the new build system that generates the PHP Manual. Written in PHP, PhD ([PH]P based [D]ocBook renderer) builds are now available for viewing at docs.php.net. Everyone is encour...

PHPReg.com
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Problem with PHP - MySQL (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Problem with PHP - MySQL
#44
forumwave (User)
Fresh Boarder
Posts: 5
graphgraph
User Offline Click here to see the profile of this user
Problem with PHP - MySQL 2 Years, 6 Months ago Karma: 0  
I want to make a short query into a db through a php script sending variables troughout POST. With mysql_error() it says that I have an error in the query : Select...
Can somebody help me with this?


[php]
<?
extract($_POST);
$ref_art=trim($ref_art);
$exi_art=trim($exi_art);

if (!$ref_art || !$exi_art)

{

echo 'No has introducido la referencia o las unidades';

header("Location: index.php";

}

$sref_art = addslashes($ref_art);

$exi_art = addslashes($exi_art);


@ $conn=mysql_pconnect("localhost","","";

if(!$conn){

echo "no existe tal bd";

}

mysql_select_db("tienda";
echo "hola";
//Ejecucion de la sentencia SQL
$query = "Select * From fal_art Where ref_art = '$ref_art'";
$result = mysql_query($query);
if($result){
$filas = mysql_num_rows($result);
echo "$filas";
}else{
echo mysql_error();
}
?>
[/php]
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#82
reen87 (User)
Fresh Boarder
Posts: 15
graph
User Offline Click here to see the profile of this user
Re:Problem with PHP - MySQL 2 Years, 4 Months ago Karma: 0  
although it is in French..but what I understand from the error and language is, you are probably not having the introductory table before your header starts..fix that..the rest of the errors would be cleared automatically..
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop

Who's Online

We have 15 guests and 15 members online
  • NefOstins
  • arrohawdolo
  • AddemoRegoMom
  • phoniantUtite
  • Rakuvinina
  • Canoraxy
  • sweamepaice
  • Bumboxbarash
  • atteftosy
  • duffallolve
  • reflexxX
  • Rissiomal
  • toomegema
  • UntotsUttetle
  • VMMark

Sponsors