rubing
-
Posts
366 -
Joined
-
Last visited
Never
Posts posted by rubing
-
-
Hey all,
I am running a script which selects mysql records based on a user input string. And then parses them out as new records based on a delimeter. This works fine. However, I also want to eliminate all the records from my table that contain the original input string. Seems like a simple DELETE command, but just won't work any way I try it! It doesn't produce an error, but doesn't delete any records either. what gives!? Please HELP!!!!!!!!
<?php include '../lib/config.inc'; include '../lib/opendb.inc'; $split_this = $_POST['split_this']; //the user input string to be split up $delimit=$_POST['delim']; //the delimeter $query = "SELECT * FROM MusicEvents WHERE Band = '$split_this'"; //THIS WORKS FINE $sql = mysql_query($query); while($row = mysql_fetch_array($sql, MYSQL_ASSOC)) { $musicians = explode($delimit,$row['Band']); foreach($musicians as $musician) { $musician=trim($musician," "); //trims space and comma from front and back $venue = $row['Venue']; $dateme = $row['Date']; echo $venue; echo $musician; $sorez = "explosion"; $querynew = "INSERT INTO MusicEvents (Source, Band, Venue, Date) VALUES ('$sorez', '$musician','$venue','$dateme')"; //Also Works!!! $sqlnew = mysql_query($querynew); } } $final_query ="SELECT * FROM MusicEvents WHERE Band = '$split_this'"; mysql_query($final_query); //This query does nothing!! ARGHHHH!!!!! echo "done"; mysql_close($conn); ?>
-
You're Great Man! Thanks.
The "R" means Read, it worked fine in the last version. I was thinking that maybe the syntax for the parameter changed or something, but couldn't find anything on it. Yeah, I should've just tried to remove it in retrospect, but just figured it was an important parameter.
-
I searched around for answer but had too much noise from webpages with similar errors.
After upgrading to PHP5 I am now getting these errors:
Warning: file() expects parameter 2 to be long, string given in /home/rubing/public_html/textpro2.php on line 19
Warning: Invalid argument supplied for foreach() in /home/rubing/public_html/textpro2.php on line 20
Appreciate some help!!
Here is my php source:
<?php
include 'config.inc';
include 'opendb.inc';
$lines = file("BHAM.txt", "r"); // LINE 19
foreach($lines as $single_line) // LINE 20
{
$value_arr = explode("\t", $single_line);
if (empty($value_arr[1])) {
$DATE = $value_arr[0] ;
}
$var1=$value_arr[0];
$var2=$value_arr[1];
$vara=html_entity_decode($var1);
$varb=html_entity_decode($var2);
$band = trim($vara);
$venue = trim($varb);
$query = "INSERT INTO test (BAND, VENUE,DATES) VALUES ('$band', '$venue','$DATE' )";
$sql = mysql_query($query);
}
mysql_close($conn);
?>
-
hmmm very interesting! I was searching the web for an article of this kind, but could not find it. Thank you!
My website is over at http://www.birminghammusiclive.com. This website gives weekly listings of live music and hyperlinks directly to musician pages. It takes a lot of time to look up all those bands and retrieve all the links, music category, etc...
Of course, anybody can look up a band name at myspace for themselves. So, its really not that valuable. The main value is in the convenience that it affords users. I highly doubt they would pay for this information. Maybe if I could also tell them all the cover charges and other kind of stuff...I don't know.
-
Good. I'll keep you in mind the next time I need to hire a lockbreaker.
-
Yes, but you have no reason to. Why would you waste your time prying open what are for you some 'child proof' locks on my website. Just for the lame challenge?? I highly doubt it!
However, I am sure there are people who would pay for a program that would do this automatically, if it doesn't already exist. $$
-
OK.
---------ENCRYPTER OFF-----------------------
The information I am trying to hide isn't that valuable and doesn't need to be protected for very long. It pertains to entertainment type events in my town. However, I don't want some other dude or newspaper or something to just swipe it off my site and use it on theirs. Since, I am putting so much work into getting it.
----------ENCRYPTER ON--------------------------
-
My data has limited inherent value as database information. I am really trying to thwart the UNLIKELY would be leacher of this data for use in the same narrow time window (~ 1 week max), Since there are similar websites to mine. Moreover, I am confident my competitors do not have a master coder such as yourself on the dockett.
-
Encoding, does not seem like it would afford much protection then ???
For now I have settled on encrypting php's html output by using HTMLProtector. I guess it encrypts and decrypts on the fly using some fancy javascript programming.
-
it's not what your after, give me a moment to find that but this might interest you...
Hex: 0x7f.0x00.0x00.0x01 Octal: 0177.0000.0000.0001
try on your local server...
Tinker,
I attempted putting this code in my web page both in the body and in links, but it didn't do anything. Am I missing something. ??? Thanks!!
-
Really cool stuff!! I'm still a noob, so might take a while to fully understand and implement. So, I guess these links will not be readable, but they could still be copied and used??
Maybe I should just copy the output of my php page and then encrypt it as html....sort of defeats the dynamic aspect and makes a lot of extra work!
-
There are a number of programs out there such as htmlprotect, which will encrypt your html source code, while still letting it be accessible to browsers. I am particularly interested in doing this to my hyperlinks.
Unfortunately, the aforementioned program does not work on php/mysql output. I would like to have the hyperlinks outputted from my mysql database by php be encrypted in the source code and not easily viewable unless clicked on. This would offer a measure of security and detterent from would be cloners as my hyperlinks are my most valuable hard earned data!! Thank-you all for any advice. You are wonderful people!! Well, not all of you, but most of you, Yes!! Especially, anyone who gives me an answer. Peace!
[SOLVED] mysql DELETE command does nothing...
in PHP Coding Help
Posted
That was a mistake in copying and pasting into this forum!!! OOOppps!!!
My code reads:
It should work perfectly b/c the initial queries based on the same variable all have no problem!!! Unfortunately no records are being deleted.