![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
dannyb785
-
Posts
544 -
Joined
-
Last visited
Posts posted by dannyb785
-
-
I want to put it on a link.
How do put your code in this link below:
<li><u><font color="#EEE"><a href='news1.html'>Investment Advisory Board Launched </a></font></u></li><br>
Regards,
Joseph
you'd do
<a href='news1.html' onClick="window.open('viewimage.php?id=64','mywindow','scrollbars=yes,width=WIDTH,height=HEIGHT')">
-
I feel dumb for not noticing the http:// before the image location.
-
Err, well then what the hell do you call a regular single quote? : '
lol I thought you meant single quotes when you said backtick.
-
No offense dannyb785, but you're criticizing peoples code and their efforts to help this person. Yet what exactly have you contributed? Apart from idiotic criticism.
If you're going to do that, make sure it's constructive criticism which will help people better their programming skills. Not everybody has an extensive experience.
Hey wolphie, wanna show me where I was idiotic? Also, show me where I told him his code was wrong. His code performs a task. I didn't think, based on the initial question, that the code provided performed the task requested. I was the first person to reply and post help! That's what I contributed. I also contributed the fact that you can't gather php code from a php file uploaded to a server just by running a fopen script.
-
I call them single quotes...
-
Dude, remember what i said about using the AS in your query? First off, you aren't grabbing any data from row['ammo'], $row['bank'], $row['money'], $row['titanium'], or $row['uranium'].
Secondly, I wasn't clear about the AS. you need to have and AS for each variable you're getting. So in your case, you'd do "SELECT SUM(ammo) as ammosum,SUM(bank) as banksum, etc..."
then after your $result is fetched, you have $row['ammosum'], $row['banksum'], etc...
So basically, you're dividing by zero because $economy has no value(so by default, a zero is used) since there are no values in $row['ammo] and so on.
-
Don't use either. You'll never learn if you have things doing the code for you. I've never used any of those programs and I do just fine.
-
Yup,it is.
cron_vibration.php
ok, do me a favor and gather the php code for facebook's /home.php
-
you're trying to print the resource that was gathered by doing the query.
A query makes a resource(or we like to call it a $result)
A $result needs to be put into $row using mysql_fetch_array().
then the variables from the database can be used. But before mysql_fetch_array(), your query is useless.
-
I wish people would stop staying that AJAX is a language. It's not. It's javascript.
who really cares? we know what they mean
-
whats on 104?
-
Except showing <?php i upload to server. read another file in that file.
and works.
may be he want to show all the code and with breaks.so has to do extra coding for that.
you didn't answer my question. Is the file a valid .php file, and you are using fopen to read the php code?
-
cleary1981, i would assume you didn't name your connection $conn. Either way, mysql_close is pretty unnecessary -- php will close the link at the end of the script for you.
danny, i do agree that it makes things clear. It's something i used to do, but am beginning to drop. I usually find that correct capitalisation is sufficient for me to follow the query. That said, if things start getting more complex, i do tend to add the backticks back in.
what are backticks?
-
oh lol oops. I was confused by the way your post was setup. I need to reread
-
the part without the "a" colors the text(and anything else that doesnt already have a specified color. and the "a" part colors the link.
Think of it like a html tag. If it was a b instead of an a, then all bolds(since the tag is < b > ) would be that color.
-
you don't need mysql_close. Where are you getting the $conn variable from??
-
you can try GingerRobot code
OR edit this to this.
$where ="WHERE type = '$model'";
nothing wrong with my code. clearly1981 clearly didn't type the code, clearly.
ah, i crack myself up
-
I have so many if and else statements in the script, I do not know what to do.
That's because you're trying to output an entirely different page depending on what variables are what value.
I don't understand... they put the right password and they are redirected to the registration page? Isn't that before registering??
-
I didn't quite understand why I was doing that. I just tried adapting code from a book to suit mine. I made the change you suggested and got the following error.
Parse error: syntax error, unexpected T_VARIABLE in C:\wamp\www\lookupdescription.php on line 9
heres my new code
<?php require "config.php"; $model = preg_replace("/[\. \(\)\-]/", "", $_REQUEST['model']); $select = 'SELECT mod_desc'; $from = ' FROM module'; $where = ' WHERE type = '$model'; $queryResult = mysql_query($select . $from . $where) or die("Error!".mysql_error()); echo $queryResult; mysql_close($conn); ?>
*slightly upset* you didn't do the code exactly as I typed it... check it again
-
may be i misinterpret him,but if you want to show the code, of course not in html form. then Wolphie code is correct.
try it yourself.
just tried:
$sql="SELECT * FROM xyz where active ='0'"; $q=mysql_query($sql); $num=mysql_num_rows($q); while ($row = mysql_fetch_object($q)) { $id=$row->id; $ch1=$row->ch1; $ch2=$row->ch2; $ch3=$row->ch3; $chp1_2_3=$row->chp1_2_3; $active=$row->active; echo $id; $sql1="update xyz set active='1' where id='$id'"; $q2=mysql_query($sql1); } ?>
did you have a beginning <?php in that code? And did you upload it to a server in .php format? And when you ran the script, did it read the php code or the output in html format? I know what the answer is. Neither of us are wrong in this thread, we are just both interpreting the guy's question differently. There is no [easy] way to get pure php code from a .php file(if that's what he's asking)
-
check other thread for answer
-
can you show us its code?
-
Ok the way you did it wayyyy crazy. Your problem is not having a '.' after $model. But the problem is bigger than that. You need cleaner code. Not only so you can do things easier, but you can find errors better and others can see your code and help you out.
Here's a better way to do what you're doing:
$where = " WHERE type = '$model' ";
Though I will say that the way you do it by breaking it up into 3 variables is very unnecessary and if anything takes up more resources by using 3 variables when you really don't even need one. Just put the entire string into the query by itself.
-
What are you trying to do? I'm positive there's a cleaner and easier way of getting it done.
[SOLVED] any work around?
in PHP Coding Help
Posted
How about my input being ignored? I said that if you're trying to grab pure php code from a php file off of a server, you can't do it. How much better does it need to be put across? I didn't provide a solution bc there wasn't one.