![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
fugix
-
Posts
1,483 -
Joined
-
Last visited
Posts posted by fugix
-
-
what version of php are you using
-
No !
-
do you have any automated fopen() functions or anything like that?
-
just use a simple if else statement
$sql1 = "select * from table_name"; $query1 = mysql_query($sql1) or die(mysql_error()); while($row = mysql_fetch_assoc($query1)) { if($_POST['date'] == $row['date']) { $date = $_POST['date']; $sql = "insert into table_name values ('', '$firstname', '$lastname', '$date')"; $query = mysql_query($sql) or die(mysql_error()); } else { echo "Date already Exists"; } }
will need tweaked but thats just to give you an idea
-
have you debugged your queries and such? Also, where is the var $cxn coming from
-
-
Welcome to phpf. Glad to have ya
-
do you receive any errors when this is tested?
-
Aha! Thanks, it's working now.
cool, glad i could help
-
you need to remove the $ , try this
<?php $content = "<html><head><title>Your IP</title></head><body>Your IP Address: 63.1.142.154</body></html>"; preg_match('/<body>(.*?)<\/body>/s', $content, $matches); print_r( $matches ); ?>
-
thats a good idea. Im going to try that. Again thanks so much for all the help. You have no idea how much i appreciate it. If anything else and hopefully there wont be, I'll save it for tomorrow. I think I need to take a break than look at everything again because its all become one big mess of code to me. I'll talk to you later. Thanks
good idea..sometimes its good to step away and come back later..if you ever need help with anything else il be here..
-
ok thank you very much!
glad i could help...
-
and honestly i would get rid of the ordernum field...i dont see the purpose for it
-
its not a huge deal, however it is a good practice to get into to use an auto-incrementing primary key field...for neatness. I normally set a field called "id" as my primary key, and make it auto-incrementing as well
-
I think it may be time to stop. Either that or I'm going to smash my computer. BAD PHOTO ID. I have no idea what else to do. First it was the header changed that than it's back to Bad photo id.
yeah im getting rather frustrated myself...but i will leave you with this....the way that you got the photo id's for the photos so when you click on a photo it shows correctly, you want to use that exact same method on everything that will be either redirecting to that page, or submitting to that page, so that you do not lose your $_GET['photoid']; since you have a dynamic url in (image_show?id=), it is crucial that you maintain the correct id on the end of the url, so that you do not lose the ability to get that id via $_GET['photoid'], that is whats hapening here. when you redirect to the image_show page again after deleting your comment, you are losing that id...i would actually advise that you write your "delete comment" code on your image_show.php page. That way there is no need to redirect and you wont lose your photoid
-
if ($post_name == 'fugix'){
echo 'sure am willing to help!'
;
}
nerds...
....stored in an array
true story
-
show me what you have now please
-
correct, but you would receive an error as well
-
make it this
<?php
require('connect.php');
mysql_select_db($database_con, $con);
$query= mysql_query( "SELECT id FROM photo");
$row_id = mysql_fetch_assoc($query);
header("Location: image_show.php?id={$row_id['id']}");
$deleteid=$_GET['id'];
mysql_query("DELETE FROM comment WHERE id='$deleteid'") or die(mysql_error());
?>
-
you dont receive any errors though?
-
for these two lines
$instrList=mysql_query("select distinct instructorId from classOfferings order by instructorId asc"); $instrNameList=mysql_query("select fName, lName from instructors where classOfferings.instructorId = instructors.instructorId order by lName asc");
use a join query to get the correct results..look here
-
try this
$result = mysql_query("SELECT filename FROM p_headerimages ORDER BY ordernum") or die(mysql_error()); $newcount = count($result) +1; $query2 = "INSERT INTO `psitez_wrdp12`.`p_headerimages` (`filename`, `ordernum`) VALUES ('$file_name', '$newcount')"; $result2= mysql_query($query2) or die(mysql_error());
-
put another one in delete.php, without the query, the call to your row in your db is useless and will return null
-
store as much information about a unique user as you can, than whens things change user an updater query...will cut down on mysql server response time
Function called on a non-object
in PHP Coding Help
Posted
read this thread here they talk about your issue...comment #26 provides a solution