Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,158,169 members, 7,835,912 topics. Date: Tuesday, 21 May 2024 at 05:24 PM

Problem With Mysql, Phpmyadmin. Pls Help - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Problem With Mysql, Phpmyadmin. Pls Help (717 Views)

Help Phpmyadmin Showing My Blank In Wamp. / Tutorials On How To Use Phpmyadmin In Your Website Cpanel / Phpmyadmin And Dreamweaver8 Uploading Picture Issues (2) (3) (4)

(1) (Reply) (Go Down)

Problem With Mysql, Phpmyadmin. Pls Help by triplee02(m): 4:08pm On Jan 19, 2010
I have been trying to create a table on my database usin mysql but each time i dont jst get it right. I used dis comment: CREATE TABLE files_images ( number int, file_name varchar(225), file_link(20), file_size(20), screen_size(20), category(20) ); but it didnt work. Or am i suppose to run d comment on a php file? I also tried usin phpmyadmin but there were some many field i couldnt fill out like table comment & odas! Pls help me
Re: Problem With Mysql, Phpmyadmin. Pls Help by DualCore1: 7:05pm On Jan 19, 2010
CREATE TABLE files_images(
number int,
file_name varchar( 225 ) ,
file_link int( 20 ) ,
file_size int( 20 ) ,
screen_size int( 20 ) ,
category int( 20 )
)
Re: Problem With Mysql, Phpmyadmin. Pls Help by yankitwizy(m): 7:12pm On Jan 19, 2010
I don't understand what you mean by - there were many fields I could not fill out using phpmyadmin.
Re: Problem With Mysql, Phpmyadmin. Pls Help by triplee02(m): 11:12am On Jan 20, 2010
Thanx but where do i run dat command. Should i run it on phpmyadmin cp or on a php file
Re: Problem With Mysql, Phpmyadmin. Pls Help by yawatide(f): 11:24am On Jan 20, 2010
in phpMyAdmin, after you create your database (you can also do this via phpMyAdmin), click your database name, click the "sql" tab to the left, and paste the above code in the window that ensues then click "go" and you should be good to go.

good luck!
Re: Problem With Mysql, Phpmyadmin. Pls Help by Ameh2(m): 4:11pm On Jan 20, 2010
hi, im simon, i really need ur help to brief me on how to upload my website, i swa ur reply on my post and really need someone to teach me this
Re: Problem With Mysql, Phpmyadmin. Pls Help by yawatide(f): 5:09pm On Jan 20, 2010
Answer to post #5:

https://www.nairaland.com/nigeria/topic-68376.0.html
https://www.nairaland.com/nigeria/topic-11927.0.html
https://www.nairaland.com/nigeria/topic-213936.0.html

Just in case you aren't aware, there is a "search" button in the navigation area of this forum. Endeavor to use it every now and then before posting as chances are that your question has already been answered by others.

Also, please create another thread next time, as opposed to continuing on another, which isn't related to yours.

Thanks in advance for your cooperation
Re: Problem With Mysql, Phpmyadmin. Pls Help by triplee02(m): 10:53pm On Jan 20, 2010
thanx it worked. My problem nw is connectin to my database. Is dis format correct <?php $con = mysql_connect("localhost","romeo",abc123"wink; if (!$con) die('could not connect: '. mysql_error()); //some code mysql_close($con); ?> & i used my subdomain 4 d localhost, but i dont knw what to use 4 d user & password. Pls help! Thanx 4 ur help i do appreciate
Re: Problem With Mysql, Phpmyadmin. Pls Help by yawatide(f): 3:09am On Jan 21, 2010
The format looks good to me.

When you run the code, what happens? Per the parameters, the host is what you will get from your webhost. Username/password is what you defined when you created the database.

good luck!
Re: Problem With Mysql, Phpmyadmin. Pls Help by triplee02(m): 1:50pm On Jan 21, 2010
Pls help me correct dis code: $count = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM users WHERE hin >= '3'"wink);

if($count[0]=="0"wink{
echo "<div class='leftline'>";
echo "<img src='images/ran.gif' alt=''/>No Site Active Now";
echo '</div>';
}else{



$sql ="SELECT * FROM users WHERE hin '3' ORDER BY

RAND() LIMIT 1";

$sites = mysql_query($sql);

while ($site = mysql_fetch_array($sites))

{

echo "<div class='leftline'>";
echo "<img src='images/ran.gif' alt=''/><a href='vsites.php?sid=$site[0]'>$site[4]</a><br/>";
echo '</div>';
} i ran it it generated errors pls help
Re: Problem With Mysql, Phpmyadmin. Pls Help by yawatide(f): 2:37pm On Jan 21, 2010
and where is the error statement?

Also, it seems you are trying to do everything in one line. It isn't helping, at least me, in following your code. I don't even see a call to your database (with host, username and password). Looking at it without the error statement, I would say, knowing fully well that there are 1001 ways to skin a cat, that everything about your code is wrong.

Post the error statement let's see.
Re: Problem With Mysql, Phpmyadmin. Pls Help by triplee02(m): 7:09pm On Jan 21, 2010
I only posted d code dat generated d error, dis d error comment: warning: mysql_fetch_array(): supplied argument is not valid mysql result resource in /www/zxq.net/m/w/a/mwap/htdocs/index.php on line 63. tanx 4 your help
Re: Problem With Mysql, Phpmyadmin. Pls Help by yawatide(f): 8:12pm On Jan 21, 2010
much better smiley

Chances are that your query is returning a single result set whereas, via your mysql_fetch_array() call, you are telling your code to expect an array. So you need to get rid of the mysql_fetch_array() call.

Alternatively, you could try this approach (note how I have broken down what you have condensed into one line, to a series of lines. This helps with readability and maintainability wink)

<?php
database calls.

$query = "SELECT name, subject, message FROM contact";
$result = mysql_query($query);

while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "Name :{$row['name']} <br>" .
"Subject : {$row['subject']} <br>" .
"Message : {$row['message']} <br><br>";
}

include 'closedb.php';
?>
Re: Problem With Mysql, Phpmyadmin. Pls Help by triplee02(m): 11:36pm On Jan 21, 2010
Thanx, get rid of d mysql_fetch_array()? Pls xplain i dnt understand.
Re: Problem With Mysql, Phpmyadmin. Pls Help by yawatide(f): 11:47am On Jan 22, 2010
Maybe you do, maybe you don't. It all depends. Again, are you intending to returning just one result set or many? If the latter, an array is warranted. If not, no. A good way to see how your query is working, and I do this all the time, is to copy it verbatim and paste/run it in phpMyAdmin. If you get an error, you note it and fix it and run it again till it works. If you don't, you note the results.

good luck!

(1) (Reply)

Blog Hey Everyone! / Thousands Of Nija, Arabs, Us, Uk, Asia Opt-in Email Addresses 4 Ur Marketing / What Kind Of Encryption Is This?

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 22
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.