-
Posts
522 -
Joined
-
Last visited
Everything posted by budimir
-
You will need to use Javascript or AJAX. Try to google for "javascript form validation".
-
@wildteen88 Very nice and clean code!
-
You are on a good forum. Try to google for basics of PHP and you will get your answer. The thing you are asking are very basic steps of PHP. Learn it, post some code and will help you with your problems. Good luck...
-
Of course, you can do it with PHP. Use counter!!
-
[SOLVED] Select Box and PHP - Can this be done?
budimir replied to Bricktop's topic in PHP Coding Help
Try Google for "Sticky forms" -
You can use SUM function in MYSQL $sql = "SELECT *, SUM(amount) as amount WHERE id = '$id' GROUP BY amount"; Something like that.. Work with it...
-
Well, this actually isn't making a lot of sence. It's working as you asked... There are simplier ways to do this..
-
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
budimir replied to topflight's topic in PHP Coding Help
You have a problem with your if statment: if $num is smaller then 0 show something?? Impossible... This is fixed: <?php $sql = "SELECT * FROM `pilots` ORDER BY `date` DESC LIMIT 7"; $query = mysql_query($sql) or die(mysql_error()); $num = mysql_num_rows($query) or die(mysql_error()); ?> <table width=73% align="center"> <tr bgcolor=#EEEEEE> <td width="10%">PID</td> <td width="15%">Name</td> <td width="17%">Hub</td> </tr> <?php if($num>0) { // <---- Bracket ONE opened while ($data = mysql_fetch_assoc($query)) { // <---- Bracket TWO opened ?> <tr bgcolor=#EEEEEE> <tr style="background-color:#EAEAEA;" onmouseover="this.style.backgroundColor='#0099FF'" onmouseout="this.style.backgroundColor='#EAEAEA'"> <td><?php echo "{$data["login"]}"?></td> <td><?php echo "{$data["fname"]}","{$data["lname"]}"?></td> <td><?php echo "{$data["hub"]}"?></td> </tr> <?php } // <---- Bracket ONE closed ?> </table> <?php } // <---- Bracket TWO closed ?> -
[SOLVED] avoiding double rows with same results
budimir replied to uisneach's topic in PHP Coding Help
$id is ID field form DB in table cancellation_train As you wrote: The table "cancellation_train" will have same fields plus id (primary key) So, if you want info about some train you do: $id = 4; //this is just an example $sql = "SELECT * FROM train_cancellation WHERE id = '4' ORDER BY id, day, month, year, hour, direction"; Hope it's more clear now... -
[SOLVED] avoiding double rows with same results
budimir replied to uisneach's topic in PHP Coding Help
?? $sql = "SELECT * FROM train_cancellation WHERE id = '$id' ORDER BY id, day, month, year, hour, direction"; ?? -
Try this: <td align=”left” valign=”top”><img src=”images/left_top.gif” border=”0”></td> Are you sure that picture extension is .gif ??? Change slash \ to / for the picture path!
-
<?php if($_POST["profile"]) { $username=$_GET["username"]; //Why are you using this??? mysql_connect("localhost","root",""); //You need pass, although it's empty mysql_select_db("Plp"); $query= mysql_query("UPDATE members WHERE pkid= '$pkid'") or die (mysql_error()); //Where do you get $pkid variable??? $num=mysql_num_rows($query); if($num == 1) { echo "update successful"; } else { $loginError= "didnt match with the database"; echo "$loginError"; } } ?> I assume that you took somebodys code and now it's not working. The code that you wrote is very bad and non functional, you had a lot of errors. I don't know will this work in the way you wanted, becasue I don't know what is it supposed to do. I just corrected the code so it could work.
-
Damn Kenrbnsn. You've beat me for a second with your reply. ;D
-
This is not the code we neeed to see. Send the code with query update. Also, it's quite poorly written.
-
Try this: <? require($_SERVER['DOCUMENT_ROOT'].'/includes/configs/sql_connect.php'); $sql = "SELECT * FROM products_description WHERE model_number=\'JT20-A8450\'"; $query = mysql_query($sql) or die ("MySQL Error: " . mysql_error()); while($row = mysql_fetch_array($query)){ $descriptions = $row['$id']; echo $descriptions; echo $row[$description]; } ?>
-
Great!!! Hit "Topic Solved"
-
Yes, it will work!
-
include("cookie.php");
-
PDF_setfont() was deprecated since PDFlib version 5 http://uk3.php.net/manual/en/function.pdf-findfont.php Check it out. That's you're problem!
-
Try some other fonts ...
-
You're file "Update_ac.php" is not complete you are missing couple of things. This is wrong: <?php $host="localhost"; $username="wowdream_domaine"; $password="mypassword"; $db_name="wowdream_domaine"; $tbl_name="members"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="UPDATE $tbl_name SET username='$username', password='$password', access='$access' WHERE id='$id'"; $result=mysql_query($sql); if($result){ echo "Successful"; echo "<BR>"; echo "<a href='editadmin.php'>View result[/url]"; } else { echo "ERROR"; } ?> This is right: <?php $host="localhost"; $username="wowdream_domaine"; $password="mypassword"; $db_name="wowdream_domaine"; $tbl_name="members"; mysql_connect("$host", "$username", "$password") or die ("cannot connect"); mysql_select_db("$db_name") or die ("cannot select DB"); $id = $_POST["id"]; $username1 = $_POST["username"]; $password1 = $_POST["password"]; $access1 = $_POST["access"]; $sql="UPDATE $tbl_name SET username='$username1', password='$password1', access='$access1' WHERE id='$id'"; $result=mysql_query($sql) or die (mysql_error()); $num=mysql_num_rows($result); if($num == 1){ echo "Successful"; echo "<br />"; echo "<a href='editadmin.php'>View result[/url]"; } ?>
-
Well you need something like ... $result = mysql_query("SELECT * FROM regusers WHERE user_id='$id'") But of course, your user needs to log in , otherwise you won't be able to know which users info to display.
-
Also on your Update_ac.php try this $id = $_GET["id"]; echo "$id"; Maybe you are not getting an ID so the query can not be updated. Also try to echo you're query to see if you are getting all the values.
-
Can you explain a little bit better and post some code so we could see what are you trying to explain??
-
Well, I liked the idea from Acs ... Try that one! It seems good enough. Although I don't know what kind of site you are running, that would be helpfull to give you some ideas!