Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
[SOLVED] Display row number column - NOT mysql row number
Maq replied to tommy445's topic in PHP Coding Help
Yeah he is definitely already doing that. Like KingPhilip said, he just needs to echo $i in the table row but increment it before he echos it. -
[SOLVED] Display row number column - NOT mysql row number
Maq replied to tommy445's topic in PHP Coding Help
I'm confused... Number column from where? If you're referring to the database table itself then you most likely have an auto-increment field that you can select in the query. If you're referring to the column number for the actual HTML output, then use $i rather then $f1: Other than that I don't really know what column you're inquiring about. -
Can we see your code? You would surround your query results in your while loop with href tags. Something similar to:
-
First of all, you were missing a " after the .jpg tag in your example image tag. I was working on this for like 10 minutes before I noticed it lol. Anyway I usually do array replacements like this: function convert_text($content) { $reg_ex[0] = '/</pre> <ul>/'; $reg_ex[1] = '/\.jpg">/'; $reg_ex[2] = '/\.gif">/'; $reg_ex[3] = '/ /'; $replace_word[3] = ''; $replace_word[2] = '.jpg" class="imgright" alt="" />'; $replace_word[1] = '.gif" class="imgright" alt="" />'; $replace_word[0] = ' '; $content = preg_replace($reg_ex, $replace_word, $content); return $content; } $w = ' '; echo convert_text($w); ?>
-
Have you seen this sticky: Web Host List?
-
He's talking about the tutorial section on the main page. When you hover over the tutorial the whole block background turns a light blue. You can do this with CSS or in Javascript. Just google, "change background color on hover".
-
[quote] Do other editors really have many more features..?[/quote] Yes, especially useful for large scaled projects.
-
Looking back at the posts I see that you didn't double post, my mistake :'(
-
Please don't double post BigTime...
-
Yes, sasa's is correct but it will only delimit every fourth number with a comma if the numbers are consecutive from 1 to 100, just in case this was an example you were trying to apply to something else.
-
It does, but when you use the inline error_reporting functions it overrides the ini setting.
-
Insert new table into mysql, phpmyadmin, using PHP
Maq replied to sridhar golyandla's topic in PHP Coding Help
Sure just do a mysqldump (you can specify a single table). Then, if you have ssh access, you can run this in the command prompt: mysql If you don't have ssh access let me know, there's another solution. -
Read this: HEADER ERRORS
-
So is filea even numbers and every fourth number separated by a comma? And fileb vice versa?
-
[SOLVED] If Image, Display - If Not, Display This Instead
Maq replied to Murdock's topic in PHP Coding Help
To start off let's debug. Remove the @ symbols because they suppress error messages. Second, change this line to: $result = @mysql_query("SELECT * FROM database WHERE blah blah blah DESC LIMIT 0,5") or die(mysql_error()); If your SQL is failing, due to your live environment, then it will display a "descriptive" error message. Also, are you sure the "path-to-avatars" is relatively the same from your local path to the live server? -
Insert new table into mysql, phpmyadmin, using PHP
Maq replied to sridhar golyandla's topic in MySQL Help
I think I answered your question in the other thread. Please don't double post, thx -
[SOLVED] Order BY- two columns of different types in mysql
Maq replied to avvllvva's topic in PHP Coding Help
This should give you the order the way you want it: SELECT * FROM table ORDER BY col_code -
Insert new table into mysql, phpmyadmin, using PHP
Maq replied to sridhar golyandla's topic in PHP Coding Help
What do you mean "Insert new table into mysql, phpmyadmin, using PHP"? Have you even tried Googling this? Create table. -
So this is a personal question, NOT a PHPFreaks question/suggestion...?
-
Maybe I'm confused but, by judging on what you're asking you're a couple things wrong... 1) If you want every fourth number why are you using modulus 2? 2) Why do you write to 2 files? 3) This should put a comma between every fourth number, from 1 to 100. $filea = fopen('filea.txt', 'wb'); for($i=1; $i{ if(($i % 4) == 0) fwrite($filea, $i . ', '); else fwrite($filea, $i. ' '); } fclose($filea); ?> If I'm mistaken on what you're trying to accomplish please, give more detail.
-
You should really look into Database normalization.
-
Nothing gives more satisfaction than changing content on a web site for a certain referrer or IP to something nasty. Sorry, I had to laugh at that, hahaha...
-
Hint: You can use the modulus operator to see if it's divisible by 4. Keep a counter in the loop and when: if(($count % 4) == 0) { //create new table }
-
Oh good. It wasn't just me then. Hahaha It's a shame because he seems like he needs a lot of help too...
-
I don't think that would matter. I've only heard of w white space issues correlated with HEADER errors.