
lordshoa
Members-
Posts
84 -
Joined
-
Last visited
Never
Everything posted by lordshoa
-
But you are not reading what i am saying are you read this "REVERSE THE ERROR MESSAGE ONLY" This what when it is wrong it will be wrong and when its right it will say its right there is no big mystery in this bit of code if it works and puts the wrong error mesage up then reverse it. Find echo 'success'; replace with echo 'error'; Find echo 'error'; replace with echo 'success';
-
lets try this and make it easy post the code that is working properly with the wrong error message please. If this is your working code which I do not know why its working with a missing curlybrase then use what I have put below <?php $con=mysql_connect("localhost","developer","javalab"); mysql_query("SET NAMES UTF8"); if(!$con) { die(' my error message '.mysql_error()); } $tID = $_POST["tID"]; mysql_select_db("cycladestravel", $con); mysql_query("DELETE FROM travels WHERE travel_id=$tID"); if (!mysql_query($sql, $con)) { echo " works great"; } die(' my error message : ' . mysql_error()); } mysql_close($con) ?>
-
If the code works reverse the error messages if(!$result){ echo 'success'; }else{ echo 'error'; }
-
$row = ("SELECT `event`FROM `pictures` WHERE id='.$id.'; print_r($row);
-
just have to click solved now.
-
Sorry my fault not reading back again $q = "DELETE * FROM pictures WHERE id ='.$id.' AND LIMIT = '1'";
-
I was looking at the wrong post after reading was the trouble I did not scroll all the way up to the top like i thought i did for the code on my first post. Your connection works so we need to fix the query to work ? You said the mysql query deleted your row ? Or does your query only delete the email address ? If it is deleting the row then change the error message around the other way and it will be right. If its just deleting the email address then use * after DELETE
-
Hard to know but will be like that for delete everything from that row had to make up variables because you have no code or datasbase feilds for me to work with. $q = "DELETE * FROM pictures WHERE id ='.$id.' AND LIMIT = '1'";
-
This will solve it then if your code works <?php $con=mysql_connect("localhost","developer","javalab"); mysql_query("SET NAMES UTF8"); if(!$con) { die('Δεν έγινε η σύνδεση με την βάση δεδομένων'.mysql_error()); } $tID = $_POST["tID"]; mysql_select_db("cycladestravel", $con); mysql_query("DELETE FROM travels WHERE travel_id=$tID"); if (!mysql_query($sql, $con)) { echo " 1 εγγραφή διεγράφη "; } die('Σφάλμα: ' . mysql_error()); } mysql_close($con) ?> No need to be rude we are trying to help you for free so be polite or
-
tell us the error you are getting then more info needed as you speak bad english Re: Query was empty « Reply #2 on: Today at 10:19:01 AM » Quote the 1st with the function conn is not working if (!mysql_query($sql, $con)) { echo " 1 εγγραφή διεγράφη "; } die('Σφάλμα: ' . mysql_error());
-
I sort of under stand can you do a orderby desc and the pick the first id so you get the highest number ? Do you have a feild ID in the ordenador table or is it id $cons = "SELECT `id` FROM `ordenador` ORDERBY DESC LIMIT =1";
-
Try writing the code in full then come back because you are asking for some one to write the code for you and not even trying.
-
Maybe if I download the database as sql and use fopen and try and work some thing from there save a lot of work.
-
Would you not have to put the value in the checkbox value ? value= '.$row['id'].' So you want some one to write you the code
-
old code $db_host = "localhost"; $db_user = "developer"; $db_pass = "javalab"; new code $db_host = "localhost"; $db_user = "developer"; $db_pass = "javalab"; $db_name = "cycladestravel"; // added the database name variable You will have to try to with a $tID =value one that you either put there or know is there for testing. so let say $tID = '1234'; $con = conn('database_name'); $result = mysql_query("DELETE `*` FROM `travels` WHERE `travel_id`='$tID' LIMIT = '1' ",$con); @mysql_close($conn); if(!$result){ echo 'error'; }else{ echo 'success'; }
-
OK I am trying to make a script to bulk import in to a database but there seems to be a problem I cannot find. So I want to manualy add from the script one item and see what has been changed in the database so I can replicate the same for my fields in my script. So I want to do a before and after so echo table -> field -> value ( has changed) So I can then add them to my script is there an easy way ? Where should I start to look function wise ?
-
Should the query not be like that ? * = everything $query=("DELETE `*` FROM `signups` WHERE `signup_email_address` = "'.$_POST['unsub'].'" AND `limit` = '1' ");
-
had productid should have been membershipid in the insert query
-
I have a query that just dies for not reason anyone see what it is. $dupresult = mysql_query("SELECT `categoryid` FROM `category_memberships` WHERE `membershipid` = '4'") or die('<br /> <br /> <font color=red> <b> MySQL Querry Not Correct select category membership select </b> </font> "'.$result[$i]['productcode'].'"<br /> <br />'); if (mysql_num_rows($dupresult) > 0) { } else { $upresult = mysql_query("SELECT `categoryid` FROM `categories` WHERE `category` = '".$result[$i]['submenu2']."'") or die ('<br /> <br /> <font color=red> <b> MySQL Querry Not Correct manufacturer select </b> </font>"'.$result[$i]['manufacturer'].'" <br /> <br />'); $row = mysql_fetch_array( $upresult ); echo 'categoryid = '.$row['categoryid'].'<br /> prodcode = '.$result[$i]['productcode'].' <br /> '; $insert = mysql_query( "INSERT INTO `category_memberships`( `categoryid`, `productid` ) VALUES( '".$row['categoryid']."', '".$result[$i]['productcode']."' )") or die('<br /> <br /> <font color=red> <b> MySQL Querry Not Correct category membership insert </b> </font>catid = '.$row['categoryid'].' --- prod = "'.$result[$i]['productcode'].'" <br /> <br />'); } If I take the die away it comes up with the right results but nothing is inserted into the database. categoryid = 10 prodcode = 14514 0 successfully inserted. categoryid = 11 prodcode = 18918 1 successfully inserted. categoryid = 10 prodcode = 25334 2 successfully inserted.
-
I am sure this is what I asked earlier today and axeia gave me the answer [^"]*. $html = ereg_replace('title="[^"]*"','',$html);
-
What happens when you select everything ? $posebna_ponuda = $db->query("SELECT * FROM objects WHERE posebna_ponuda = "1" ORDER BY RAND() LIMIT 5");
-
Thank you worked perfectly.
-
I have a scraper I am trying to get code form another site and just get the text from the code. But I seem to have run in to a problem I cannot figure out. The code has random name and a unix time stamp which changes in a div tag and in a li tag so when I ereg_replace I use (.*) but it seems to take to much and not stop or nothing at all. Is there a better way of making the variable code replace able ? random_name unix_time_stamp thanks little sample <li class="class1 status u_RANDOM_NAME" id="status_UNIX_TIME_STAMP"> $htlm[1] = ereg_replace('<li class="class1 status u-.*." id="status_.*." >','',$html[1]);
-
It is possible but depends on the server if it is allowed. chmod("/somedir/somefile", 0755);
-
Including a PHP variable as part of an <a href....>text</a> HTML tag
lordshoa replied to Jodha's topic in PHP Coding Help
kittrellbj suggests case is the switch it is what changes the switch to the page from the menu and in the main.php would be the pages 0 to 2 default being the page everyone sees first index.php?id=0 index.php?id=1 index.php?id=2 So maybe you should follow his suggestion it looks like what you wanted to know.