-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
Drop the "group by" at the end of that query, you want to pull all the results out: but only display them in a specific way. You are going to need to code some conditional output into the while loop. Using if's to check if the countryid has changed, then if the sub region id has changed in oreder to format what you output to the screen. Have a bash at it and let us know if you have any problems.
-
Need help with php mysql database - maintenance?
Muddy_Funster replied to andy_b_1502's topic in PHP Coding Help
I would also like to suggest that you make sure that your input fields are properly escaped as well as sanitised before hitting the database. It's likely that those 1 and 1 fields are being populated by someone trying to hack your user table with a brute force injection attack. As well as that, I have to assume that you are storing the password as plain text (exactly what they type in the form is what is stored in the table). This is bad if you are, if someone does successfully hack your user table all the information could be handed over to them on a silver platter. You should look into encrypting passwords stored in the table if you are not doing so already. -
I feel a more significant difference at this level is that with "print" you can not pass multiple string values into it, unlike "echo".
-
Insert into auto increment and remember the value?
Muddy_Funster replied to joe92's topic in MySQL Help
ok, you don't insert anything into an auto inc filed - EVER. You can't retrieve a resultset from running an INPUT statement. If you want information out of the database you are going to need to run a SELECT on it, so you will need another query. -
I would need to see the code for index.php, menu.php, and a sample content page to provide that level of information. It will also likely requre a significant re-write of the code, not something that can be posted up in a hurry. If the OP is prepared to provide the affore mentioned code I will happily have a look at what can be done.
-
Echo and Print are not exactly the same.
-
that's really not the best way to do it, you are going to have a hell of a time maintaining that.
-
try using isset and {} :- if(isset($_SESSION['name'])){ echo "<option value={$_SESSION['name']}>{$_SESSION['name']}</option>"; }
-
if that doesn't fix it we could use a look at your confirm_query() function.
-
which part do you need help with exactly?
-
that is correct. In this case you can use $i = strrpos($query, " "); $ query=substr_replace($query, ":", $i, 1);
-
you could try str_replace (" ", ":", $query, 1);
-
what about making this change if(trim($file) == '#3#'){
-
following the link to http://www.imdbapi.com/?i=tt1324545 you will see that the target page is returning the parse error, not your code. the problem is with the value of tt1324545 - the target site does not like it. revise the values in your database and make sure they are correct.
-
ahh. I only ment for you to change the letters in assoc: while($info = mysql_fetch_assoc($f)) {
-
that ones my dyslexia kicking in >_< it should be "mysql_fetch_assoc()"
-
help needed inserting blobs via odbc in oracle database
Muddy_Funster replied to arestas's topic in PHP Coding Help
maybe this can help, it's based on sql server but it's talking about odbc in php - http://stackoverflow.com/questions/689735/insert-binary-data-into-sql-server-using-php -
more sillyness on my part : remove the word "htmlencode" from this line: $tid= htmlencode $info['id'];
-
I missed the ; from the end of the line starting with $url add that in and see what happens.
-
what does this return? <?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("base") or die(mysql_error()); $f = mysql_query("SELECT id FROM movies") or die(mysql_error()); while($info = mysql_fetch_asocc($f)) { $tid= htmlencode $info['id']; $url = "http://www.imdbapi.com/?i=$tid" echo "<br>$url<br>"; $link = file_get_contents($url); $json = json_decode($link,true); print_r($json); echo "<br><br><strong>".$json['Title']."</strong><br><br>"; } ?>
-
I only gave you 4 lines of code, can we see your full page of code?
-
a better way would be <?php include("config.php"); $content = $_POST['content']; $link = $_POST['link']; $title = $_POST['title']; $pass = $_POST['password']; $qry = "UPDATE sites SET content = '$content', link = '$link' WHERE title='$title' and password='$pass'"; mysql_query($qry) or die (mysql_error()); echo "Site Updated"; mysql_close($con); ?>
-
this is actualy a PHP issue, but your solution is : ... $link_info = $info['id']; $link = file_get_contents("http://www.imdbapi.com/?i=$link_info"); $json = json_decode($link,true); echo $json["Title"]; ...