Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have an store procedure ...

DELIMITER $$
create procedure getdatabyinput1
(

IN Uname int

)
BEGIN
SELECT UserNameID,userName,pass FROM username
where userName=Uname;
END $$

DELIMITER ;


and my php script is ...


$Uname=$_POST['user'];
$Upass=$_POST['pass'];

$result= mysqli_query($con,'CALL getdatabyinput1($Uname)') or die("wrong1");


While($row = mysqli_fetch_array($result))
{
echo $row['userName'] . " " . $row['pass'];
echo "
";
}


i also search on google .. but unable to understand , actually i am new to php .. so pls describe if possible
Posted

 
Share this answer
 
Comments
GDdixit 6-Dec-13 6:03am    
i have seen this before and also my passing parameter process is like this . but it's not working . see my php code dude ...
CPallini 6-Dec-13 6:13am    
Then you have to perform some debugging, that is:
make sure your stored procedure is OK (call it from command line interface)
make sure your connection is OK.
try to pass a know value (a constant string) as parameter to the stored procedure.
...
These functions allow you to access MySQL database servers. More information about MySQL can be found at » http://www.mysql.com/.

Documentation for MySQL can be found at » http://dev.mysql.com/doc/.
 
Share this answer
 
XML
<?php
$conn = mysql_connect('localhost:3306', 'user', 'password');
if (!$conn) {
   die('Could not connect: ' . mysql_error());
}
mysql_select_db('database');
$result = mysql_query('select * from table');
if (!$result) {
   die('Query failed: ' . mysql_error());
}
/* get column metadata */
$i = 0;
while ($i < mysql_num_fields($result)) {
   echo "Information for column $i:<br />\n";
   $meta = mysql_fetch_field($result, $i);
   if (!$meta) {
       echo "No information available<br />\n";
   }
   echo "<pre>
blob:         $meta->blob
max_length:   $meta->max_length
multiple_key: $meta->multiple_key
name:         $meta->name
not_null:     $meta->not_null
numeric:      $meta->numeric
primary_key:  $meta->primary_key
table:        $meta->table
type:         $meta->type
unique_key:   $meta->unique_key
unsigned:     $meta->unsigned
zerofill:     $meta->zerofill
</pre>";
   $i++;
}
mysql_free_result($result);
?>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900