would you mind if i ask you post your code here...
That way i can help you more quickly...
User Profile
Collapse
-
Need help in passing a javascript variable into a hyperlink
Hi friends...I need our help.I'm stuck with this code...
can some one tell me how can pass a javascript variable into hyperlink along with a php varaible?
Here is my code..
[code=html]
<html>
<head>
<script type="text/javascript">
function favBrowser()
{
var mylist=document .getElementById ("myList")
document.getEle mentById("favor ite").value=myl ist.options[mylist.selected Index].text... -
-
Hi buddy..
here is the sample code that will search and returns results from database based on your input.
[PHP]
<?php
if($_POST['submit'])
{
$dbconnect=mysq l_connect("host name","rootname ","password ");
mysql_select_db ("database_name ");
$sql="select * from TABLE_NAME where COLOUMN_NAME='$ _POST[text]'";
$query=mysql_qu ery($sql,$dbcon nect);...Leave a comment:
-
Remove the double qoutes in your mysql_connect & mysql_select_db query.
Because $host="localhos t" so you dont need them again
...Code:mysql_connect($host,$root,$password); mysql_select_db($dbname);
Leave a comment:
-
Hi punitshrivastav a,
i've gone through your code....
replace this query
$dbconnection=m ysql_connect($h ost,$username,$ password) or die("cannot connect");
and also
$result = mysql_query($sq ls,$dbconnectio n);
if you still can't get the desired result try to echo every sql statement....Leave a comment:
-
hi pal,
@ is an error suppression operator.Genera lly used to display our own
(User specified) error messages.
Here is the sample code ....
// Connect to the database server
$dbcnx = @mysql_connect( "localhost" , "root", "");
if(!$dbcnx)
{
echo "<P>Unable to connect to the database server at this time.</P>";...Leave a comment:
-
[CODE=php]
you can make use of foreach loop
foreach($_POST as $value)
{
if (!$_POST[$value])
{
$err .= "$value is a required field <br>";
}
}
if ($err)
{
echo $err;
}
else
{
// Continue with script
}
[/CODE]Leave a comment:
-
simple...
put your function in an if block.....
something like
[CODE=php]
if($_POST['name_of_submit _button '])
{
and call your function here......
handle_error($s omething,$somet hing)
}
[/CODE]Leave a comment:
-
now() integer format
I've inserted a record into mysql db using now() function value.
just like...
insert into TABLE_NAME(date ,name,age)value s(now(),'Naresh ','24')
when tried to echo the date filed value on the local system,it gives me 2007-06-06 13:14:16.
But on the live system it gives me as 20070606131416( I dont want this format).
It's weird and i can't understand what the problem.
And...
No activity results to display
Show More
Leave a comment: