Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
I use this (well, an older version of) to connect older camcorders & ps2/xbox to the pc for recording: http://www.pinnaclesys.com/PublicSite/us/Products/Consumer+Products/Dazzle/Dazzle+Video+Archiving/Dazzle+DVD+Recorder.htm That won't do everything... but if you tell us what you have, we might be able to help you better ;)
-
Try this: [code]<?php //start the games session session_start(); //connect to database include("connect.php"); //query to determine wether player table is empty $ap_query = "select id,name,surname,ability,fitness,skill,position,prefmove,description,teamtalk from player order by surname"; $allplayers = mysql_query($ap_query); //query to select total of players $tp_query = "select count(id) as total from player"; $total_players = mysql_query($tp_query); $a = mysql_fetch_array($total_players, MYSQL_ASSOC); //var containing total of players $total = $a['total']; //vars to hold player details $id = "id"; $name = "name"; $surname = "surname"; $ability = "ability"; $fitness = "fitness"; $skill = "skill"; $position = "position"; $prefmove = "prefmove"; $description = "description"; $teamtalk = "teamtalk"; //if form is submitted add details to the table if(isset($_POST["add_players"]) && isset($_POST["gamename"])) { //vars to hold insert data $gameid = $_GET['gameid']; //THIS IS THE GAMEID VARIABLE $players = $_POST["add_players"]; $gamename = $_POST["gamename"]; $test = count($players); echo $gamename . '<br />'; if(($test > 5 ) || ($test < 5)) { echo 'You have not selected 5 players <br />'; } else { foreach ($_POST["add_players"] as $players) { //insert query $addsql = "insert into `game` (`id`, `gameid`, `gamename`) values ('".$players."','".$gameid."','".$gamename."')"; mysql_query($addsql) or die (mysql_error()); } //query display players selected $testquery = "select `name`,`surname` from `player`,`game` where player.id = game.id and gameid = '".$gameid."'"; $test2 = mysql_query($testquery); echo ''; if (mysql_num_rows($test2) !== 0) { while($row = mysql_fetch_assoc($test2)) { echo $row['name'] . ' '; echo $row['surname'] . '<br />'; } } } } else { echo 'No players chosen'; } if (isset($_POST['delete'])) { $deletesql = "delete from `game` where `gameid` = '".$gameid."'"; //$deletesql = "delete from game"; mysql_query($deletesql) or die (mysql_error()); } require("players.view.php"); ?>[/code]
-
[code]<?php if(!$slot_1) { $slot = '2'; } else { $slot = '1'; } ?>[/code] ??? ??? You're going to have to give a lot more detail and show some of your code in order for us to understand what you're asking for.
-
[code]<?php include('incl_db.php'); include('function.inc'); if ($_POST['Submit']) { $connection = mysql_connect($host, $user, $password) or die ("Couldn't connect to the server."); // Connect $db = mysql_select_db($database, $connection) or die ("Couldn't select database."); $table_id = Trim(stripslashes($_POST['table_id'])); //Set variables $company = Trim(stripslashes($_POST['company'])); $amt_tix = Trim(stripslashes($_POST['amt_tickets'])); $comments = Trim(stripslashes($_POST['comments'])); $sql = "SELECT * FROM `Table` WHERE `table_id`='".$table_id."'"; // SQL statement - select all from table where the table id matchs the inputted one $result = mysql_query($sql) or die("could not execute! ".mysql_error()); $num = mysql_num_rows($result); // If any matches... if($num > 0) { print "That table has already been reserved.)"; // tell the user that is has been taken include ("reservetable_form.inc"); //show form exit; // exit script } else { $sql2 = "INSERT INTO `Table` ( `table_id` ,`company` , `table_amt` , `comments` ) VALUES ('".$table_id."' , '".$company."', '".$amt_tix."', '".$comments."')"; //SQL statement for inserting into the DB $result2 = mysql_query($sql2) or die("Couldn't execute query. ".mysql_error()); header("Location: index.php"); // Go back to index } } ?>[/code] I would recommend having something to tell the user that they successfully reserved that table, instead of just redirecting them instantly
-
When using a variable in double quotes, you have to either "bla blah". $bear ." blah" it. You have to end the quote, have a continuation (the period) and then show your variable. ...or use curly braces " blah blah {$bear} blah"
-
Normally, I do [code]<?php if(!$res) { echo "The insert failed!"; } else { echo "The movie was added!"; } ?>[/code]
-
I still use the individual ones... I don't think I'll ever change. You never know. ;)
-
Sadly, I prefer XP.... Mac is too simple for me, I like more options... and Linux, well, I use Ubuntu every now and then, but I just can't get into it too much. I guess it was because I was raised around Windows (Yay Windows 3.1! :P)
-
I just noticed: You're echoing this: <?include"header.php";?> </div> <div class="content"> <div class="clear10"> </div> <div style="text-align:center"><img alt="Loading..." src="/images/loading_animated3.gif"></div> </div> <div class="footer"> <?include"footer.php";?> You should echo everything but the includes. Change your echo html to this: [code]<?php echo' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <title>TzFiles - Free Ultimate File Hosting</title> </head> <body> <div class="container"> <div class="header">'; include"header.php"; echo '</div> <div class="content"> <div class="clear10"> </div> <div style="text-align:center"><img alt="Loading..." src="/images/loading_animated3.gif"></div> </div> <div class="footer">'; include"footer.php"; echo'</div> </div> </body> </html>';?>[/code]
-
I'm guessing the problem was within the $_POST data?
-
It doesn't show anything at all? Not even something like INSERT INTO... ? What about you post values, are you sure those are the correct names? Because if one is missing then it won't run the code. Try changing odbc_close($conn); } to this: odbc_close($conn); } else { echo "No colors!"; }
-
Try adding single quotes around it VALUES ('".$_POST['title']."', '".$_POST['description']."', '".$_POST['category']."')
-
Also, $sql = "INSERT INTO dvd (title, description, category) VALUES ($_POST['title'], $_POST['description'], $_POST['category']"; should be $sql = "INSERT INTO dvd (title, description, category) VALUES (".$_POST['title'].", ".$_POST['description'].", ".$_POST['category'].")";
-
I see it: THe line with this: $sql = "SELECT * FROM dvd WHERE title = '".$_POST['title']"'"; Should be: $sql = "SELECT * FROM dvd WHERE title = '".$_POST['title']."'";
-
I think this is one correct way of doing it. [code]<?php //define the path as relative $path = "211612151419/"; //using the opendir function $dir_handle = @opendir($path) or die("Unable to view Flash Portal in $path"); echo "Flash Portal $path<br/>"; $count = 0; //running the while loop while ($file = readdir($dir_handle)) { if($count == 20) { break;} // If 20 results, stop loop if($file!="." && $file!="..") $ext = substr($file, strrpos($file, '.') + 1); // get extension if($ext == "php") { // if .php echo "<a href='$file'>$file</a><br/>"; // echo link } $count++; } //closing the directory closedir($dir_handle); ?> [/code] I could be completely wrong, and if I am, Sorry! :(
-
Hmm... okay, try this: [code]<?php $conn = mysql_connect("localhost", "brandi", "bc5106") or die(mysql_error()); mysql_select_db("movies") or die(mysql_error()); $sql = "SELECT * FROM dvd WHERE title = '".$_POST['title']"'"; $res = mysql_query($sql) or die($sql."<br><br>".mysql_error()); if (mysql_num_rows($res) > 0) { echo "This movie already exists."; } else { $sql = "INSERT INTO dvd (title, description, category) VALUES ($_POST['title'], $_POST['description'], $_POST['category']"; $res = mysql_query($sql) of die($sql."<br><br>".mysql_error()); if (mysql_affected_rows($res) > 0) { echo "Your movie was successfully added."; } else { echo "The insert failed."; } } ?> [/code]
-
[code]<?php if(isset($fathers_email) { if(!strstr($fathers_email,"@") || !strstr($fathers_email,".")) { echo "Incorrect email address formatting!"; } else { echo 'Enrollment Application Step 5</font></b></font><p><font face="Verdana" size="1">Please '; echo 'complete the form below to reserve your child\'s '; echo 'spot. While it does not guarantee that an opening will be '; echo 'immediately available, it does promise that the next available '; echo 'spot will be held for your child. <font color="#CC3300">To '; echo 'avoid delays </font></font>'; } } else { echo 'Sorry all required fields were not filled out, please <a href="javascript: history.go(-1)">go back</a> and correct Father\'s Email Address. '; } ?>[/code]
-
What's the rest of the code? You keep cutting it off at echo '
-
What does the page say It should say something like: [quote]INSERT INTO table1....[/quote] Don't look at the database right now, just the php page and what it outputs.
-
The little guy, please get on MSN and accept my friends invite. I would like to show you something that is more private regarding the security.
-
[code]<?php error_reporting(E_ALL); ini_set("display_errors","1"); if (isset($_POST['Color1']) && isset($_POST['Color2'])) { $Color1 = $_POST['Color1']; $Color2 = $_POST['Color2']; $conn = odbc_connect('Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\Program Files\Abyss Web Server\htdocs\p\php imput box\mydb.mdb','',''); $sql = "INSERT INTO Table1 (Color1, Color2) VALUES ('$Color1', '$Color2')"; echo $sql; if (odbc_exec($conn,$sql)) { echo "insert success"; } else { echo "insert failed<br />"; echo odbc_error()."<br />"; echo $sql; } odbc_close($conn); } ?>[/code] What does it say now?
-
Try this: [code]<?php error_reporting(E_ALL); ini_set("display_errors","1"); if (isset($_POST['Color1']) && isset($_POST['Color2'])) { $Color1 = $_POST['Color1']; $Color2 = $_POST['Color2']; $conn = odbc_connect('Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\Program Files\Abyss Web Server\htdocs\p\php imput box\mydb.mdb','',''); $sql = "INSERT INTO Table1 (Color1, Color2) VALUES ('$Color1', '$Color2')"; if (odbc_exec($conn,$sql)) { echo "insert success"; } else { echo "insert failed<br />"; echo odbc_error()."<br />"; echo $sql; } odbc_close($conn); } ?>[/code] There were a few typos in thorpe's coding. ;)
-
try: [code]<?php if(isset($fathers_email) { // code for if there IS an email (validation goes here) } else { // code for if there is NO email } ?>[/code]
-
Try this first, please tell us the results: [code] <?php $query = "INSERT INTO db (name, type, phone, city, county, email, web, description) VALUES ('$name', '$type', '$phone', '$city', '$county', '$email', '$web', '$description')"; $result = mysql_query($query) or die(mysql_error()); echo $query; ?>[/code] If it shows something like [quote]INSERT INTO db (name, type, phone, city, county, email, web, description) VALUES ('', '', '', '', '', '', '', '')[/quote] Try this next one: [code] <?php $query = "INSERT INTO `db` (name, type, phone, city, county, email, web, description) VALUES ('".$name."', '".$type."', '".$phone."', '".$city."', '".$county."', '".$email."', '".$web."', '".$description."')"; $result = mysql_query($query) or die(mysql_error()); echo $query; ?>[/code]
-
"VALUES ('$Color[b]''[/b])"; You have 2 single quotes (')